Skip to main content

dbtool

A lightweight db tools for sql.

pip install dbtool
# sqlite3 ....
db = dbtool.connect('sqlite:///:memory:')
db = dbtool.connect('mysql://root:123456@127.0.0.1:3306/test',  mincached=1, maxconnections=20)

# sql
db.execute(sql)
db.execute_fetchone(sql)
db.execute_cursor(sql)
db.execute_batch(sql)
db.execute_script(sql)

# crud
db.insert(user)
db.update(user)
db.delete(User, {'id': 1})
db.find(User, {'status': 1})
db.find_one(User, {'id': 1})
db.find_count(User, {'status': 1})

# transactions
with db.transaction():
    db.execute(sql1)

db vs driver

  • sqlite - sqlite3
  • mysql - pymysql
  • postgresql - psycopg2
  • sqlserver - pymssql

Metadata

Release files for dbtool 0.2.0

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

Source distribution (sdist)

Source distribution for dbtool 0.2.0
File Size Uploaded
dbtool-0.2.0.tar.gz 5.7 kB Details

Built distribution (wheel)

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

Total release size: 11.6 kB

Release files / dbtool-0.2.0.tar.gz

Download URL dbtool-0.2.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a414f61c84d6032e8136513e886afc7eca2f92a1ec8e7f210de1b2e82d3eb5c8
BLAKE2b-256 checksum
How to use checksums
ae84ad993a7b089f12281063a8365c891c8df54caf5e3cd874f340903d2bfe77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.9.6 Darwin/22.1.0

Release files / dbtool-0.2.0-py3-none-any.whl

Download URL dbtool-0.2.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f4b7e01dd93db63a2337772af8b51dc49f20f0caf4deeaebb8fa19e7e5be69b
BLAKE2b-256 checksum
How to use checksums
85de4cdf53e0ce23decb991fda01f720f1e2920302ec4bc595948a6094c30d13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.9.6 Darwin/22.1.0

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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