Skip to main content

SQL dump 切分SQL

Project description

支持的文件格式

  • gz
  • zip
  • sql

分割 SQL

调用方式

from pathlib import Path

# absolute_file_path 读取文件的绝对路径
# absolute_out_put_folder 输出的文件夹的绝对路径
# 返回的 任务ID
task_id = SliceFactory.slice(absolute_file_path=Path("D:\\workspace\\Resources\\eclinical_edc_prod_21_20230630025243.sql.gz"), 
                   absolute_out_put_folder=Path("YYYYY"))

输出的结果

img.png

YYYYY 输出的文件夹
cdfe5a8a9811459d9b0a940aa86abd89 根据任务 ID 生成的对应文件夹
CREATE 创建 表单的 SQL 语句
INSERT 插入 表单数据的 SQL 语句
file_list.json 生成的文件信息

SQL 文件名的格式:{表名}-{uuid}

获取 SQL 文件信息

# where SQL 文件夹的绝对路径
file_list = FileInfoList(
        where=Path("D:\\aws\\eclinical40_auto_testing\\slicing\\src\\slicing\\XXXX\\89f20cdac717425091fb0fb9220481fe"))

文件信息

sql_type CREATE(创建表单) 或 INSERT(插入数据)
name 文件的全名 {table}-{id}
table 表名
id uuid
size 文件大小,单位字节

获取表名

file_list = FileInfoList(where="文件夹的绝对路径")

# FileInfoList.CREATE_LIST  创建表单S表名
# FileInfoList.INSERT_LIST  插入表单数据的表名
# FileInfoList.ALL_LIST     所有创建表单和插入表单数据的表名的交集
file_list.table(mode=FileInfoList.CREATE_LIST)

根据表名获取 文件信息

file_list = FileInfoList(where="文件夹的绝对路径")

# FileInfoList.CREATE_LIST  创建表单的SQL
# FileInfoList.INSERT_LIST  插入表单数据的SQL
# FileInfoList.ALL_LIST     所有创建表单和插入表单数据的所有SQL
# 返回的是一个列表
sqls = file_list.find("eclinical_crf_item", mode=FileInfoList.ALL_LIST)

获取 文件信息

file_list = FileInfoList(where="文件夹的绝对路径")

# FileInfoList.CREATE_LIST  创建表单的SQL
# FileInfoList.INSERT_LIST  插入表单数据的SQL
# FileInfoList.ALL_LIST     所有创建表单和插入表单数据的所有SQL
# 返回的是一个列表
sqls = file_list.lists(mode=FileInfoList.INSERT_LIST)

Release 1.0.1

  1. 修改了生成的文件ID和记录的文件ID 不一致的BUG
  2. 在文件信息中,增加了文件大小信息,单位为字节

Release 1.0.2

  1. SliceFactory is_valid_folder_name 修改了正则表达式

Release 1.0.3

  1. 修改了writer结束线程的条件

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slicing-1.0.3.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

slicing-1.0.3-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file slicing-1.0.3.tar.gz.

File metadata

  • Download URL: slicing-1.0.3.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for slicing-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9c92b1b4cb68626088f78f482b15a115393eccd624f50fc36b9bdd5dcc00da3f
MD5 2baf8c52034958dfff55d035910587e3
BLAKE2b-256 53f7473c7ee93bccdcb4e2d44209e286fc7cb48fbd4ca3e6aff7c9b42c3f2fe6

See more details on using hashes here.

File details

Details for the file slicing-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: slicing-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for slicing-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a3097b4abbbecab91f2a2ca6a62088efc2d1ce28321d68a5f97de1a6f0cb5717
MD5 b77781fa1cc03e344ae9a5eab63ad7f2
BLAKE2b-256 78f95e7e2cf2a48038c7f4f096b137adbc0e342a26c841e4bfcf07a0f71b9998

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page