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. 在文件信息中,增加了文件大小信息,单位为字节

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.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

slicing-1.0.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: slicing-1.0.1.tar.gz
  • Upload date:
  • Size: 8.1 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.1.tar.gz
Algorithm Hash digest
SHA256 b6ba05f590f6d586925d83087a99491427106c7476aab560c764ce83a9a934c4
MD5 536661de9c80752449b6ad561aa42e44
BLAKE2b-256 11d011519598e3ab2186f634d380c409ec765a0cdee7a69fdaf90d30382faefb

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: slicing-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88eaf4356dc236f127b7906697dc4d249b3fa21e98cf373f8c0c24a5f2842dc2
MD5 c64bc39ca542f38ac49faf46b3b8d94f
BLAKE2b-256 b33bce54faef78d7f5021e2b6c80cf7070d2d05ca8ce77ceea96ecf6b108cfb1

See more details on using hashes here.

Provenance

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