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"))
输出的结果
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 |
获取表名
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)
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.0.tar.gz
(7.9 kB
view details)
Built Distribution
slicing-1.0.0-py3-none-any.whl
(11.3 kB
view details)
File details
Details for the file slicing-1.0.0.tar.gz
.
File metadata
- Download URL: slicing-1.0.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f4d42551da5ad4e74857c4034531cc14782eb5a63c1d6570bb47a5503874406 |
|
MD5 | 48201e93d9f3663ba83503b917c49b0a |
|
BLAKE2b-256 | 136347d366b8fc0e09589eba657def25ff3f520dcd482f3281bc782b6645a1b6 |
File details
Details for the file slicing-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: slicing-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3393306dd8382c438411f628e87b51c750f1ef302c73e9900f6163b2af8aaba |
|
MD5 | 1fe053eb06e9745cf338e906e1777f58 |
|
BLAKE2b-256 | 9f555dec6a68c24182f6c2aef831f4fcd11cbf5b0c610e073efc4112116e63bc |