Skip to main content

This library provides functions for querying the latest partitions of MySQL database partition tables and creating table partitions.

Project description

说明[tips]
提供mysql数据库的分区表最新分区查询,支持分区字段为DATE或TO_DAYS(date_str)类型的数据表新建分区,依赖库包括:"pandas", "pymysql", "sqlalchemy".
[Provide the latest partition query for the partition table of MySQL database, supporting partition fields of DATE or TO_ Create new partitions for DAYS (date str) type data tables, with dependency libraries including "pandas", "pymysql", and "sqlalchemy".]

安装[install]
pip install mysql-partition

使用[use]
在使用之前请准备好数据库连接字典db_info [Please prepare the database connection dictionary db_info before use.]
db_info = {
"host": "127.0.0.1",
"port": 3306,
"username": "root",
"password": "lytcreate",
"database": "yt_zz"
}

1.获取指定数据库所有分区表的表名及最新分区[Obtain the table names and latest partitions of all partition tables in the specified database.]
import mysql_partition

res = mysql_partition.show(db_info) // return mysql partition dict.

2.创建指定数据库的所有分区表至指定分区日期,不指定日期则默认为执行当天[Create all partition tables for the specified database until the specified partition date. If no date is specified, it defaults to the execution day.]
import mysql_partition

mysql_partition.create(db_info, "2023-01-01") // Create all partition tables until January 1, 2023

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

mysql_partition-1.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

mysql_partition-1.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mysql_partition-1.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for mysql_partition-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4da5da0b72d13aff540ba8dd6366cb6dc3c508e6ea390d0f4fac14958851f736
MD5 f723be6f87528c97968702fd2bbc2c43
BLAKE2b-256 b3ca839d0afee5d854d298f0c91043526e7a8f7d2cec65dc039927bf4621ada8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_partition-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7314cc2b12387495849414eb8f974fd95be19048b2a9bd23252974493a81fce3
MD5 cd49a811815e3ec554746ec798fd8527
BLAKE2b-256 0d4a2dc0ba043e5acb2a893914f58ac5217f8612e6f68f975a9f05a0d8c4e754

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