Skip to main content
简单的mysql封装库

使用非常简单, 直接调用方法操作, 不需要再去想sql代码了

测试代码:
if __name__ == '__main__':
# 创建操作数据库的实例
sql = zsql()
# 创建一个库
sql.create_db('db_name')
# 使用库
sql.use_db('db_name')
# 创建一个表
sql.create_table_ex('table_name', ID='int', name='char(16)', pwd='char(32)')
# 保存数据
sql.save_values('table_name', (0, '用户0', '密码0'), (1, '用户1', '密码1'))
# 更新数据
sql.update('table_name', new_item=dict(name='新用户名', pwd='新密码'), where=dict(name='用户1', pwd='密码1'))
# 查询数据
data = sql.select_all('table_name')
# 删除表
sql.drop_table('table_name')
# 删除库
sql.drop_db('db_name')
# 显示数据
for v in data:
print(v)
# 关闭
sql.close()

'''
打印出以下结果
CREATE DATABASE IF NOT EXISTS db_name DEFAULT CHARSET=utf8;
USE db_name;
USE db_name;
CREATE TABLE table_name (ID int, name char(16), pwd char(32)) DEFAULT CHARSET=utf8;
INSERT INTO table_name VALUES (0,'用户0','密码0'), (1,'用户1','密码1');
UPDATE table_name SET name = '新用户名', pwd = '新密码' WHERE name='用户1' AND pwd='密码1';
SELECT * FROM table_name;
DROP TABLE IF EXISTS table_name;
DROP DATABASE IF EXISTS db_name;
(0, '用户0', '密码0')
(1, '新用户名', '新密码')
'''


Metadata

Release files for zsql 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zsql 1.0.2
File Size Uploaded Provenance
zsql-1.0.2.tar.gz 5.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for zsql 1.0.2
File Interpreter ABI Platform
zsql-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / zsql-1.0.2.tar.gz

Download URL zsql-1.0.2.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
afcbdafadb087b1d4412ba0a730a1b0977565ad05eca389d9a5b1ef87219aa4f
BLAKE2b-256 checksum
How to use checksums
3746c56518cd60ca74333438eccf392f8007630e4d776e68c07b322cd1e82b05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

Release files / zsql-1.0.2-py3-none-any.whl

Download URL zsql-1.0.2-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b5519b02bdcb3bc3497f62d5b6e1bcaf2c10e71349b671093f77b64594cc694
BLAKE2b-256 checksum
How to use checksums
67ac52f6b0d4379701ff8fd94d8f5a71724432fbf950f6f8bb0ae315aebd6e54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

Security for zsql 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page