A lightweight db tools for sql.
Project description
dbtool
A lightweight db tools for sql.
pip install dbtool
# sqlite3 ....
db = dbtool.DB('sqlite:///:memory:')
db = dbtool.DB('mysql://root:123456@127.0.0.1:3306/test?client_flag=65536', 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', dict)
db.update('user', dict)
db.delete('user', id=1)
db.find('user', type=0)
db.find_one('user', id=1)
db.find_count('user', type=0)
# transactions
with db.transaction():
db.execute(sql1)
db vs driver
- sqlite - sqlite3
- mysql - pymysql
- postgresql - psycopg2
- sqlserver - pymssql
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
dbtool-0.1.0.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file dbtool-0.1.0.tar.gz
.
File metadata
- Download URL: dbtool-0.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af930444f7a154b2c6c9fedbb6c6eb411ee499efc21ea5e509e4ef78bf03f02f |
|
MD5 | 984b12b7734050e491f202baa56280fe |
|
BLAKE2b-256 | 5995e5d22ce56fc2dff0521a8b0114b7ccf290f3049a7f3920d4ecb4f91d5b89 |
File details
Details for the file dbtool-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: dbtool-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54b66deabe525f15e3af87bec6195eb3c9a4193e089d7502c78844402cc6eec4 |
|
MD5 | bdb14e5483797d09ee53cc2d513632b8 |
|
BLAKE2b-256 | e1bf00fbae183e841375338b74ca61b9949166f0a75947f8f305643ff91f4db4 |