Context manager for Sqlite databases
Project description
SQLITE3 CM
SQLITE 3 CM is a context manager,
😃
A way TO USE with
statement on sqlite databases !! (WITHOUT CLOSING OR OPENING ANYTING 🤩)
Install 📦
pip install sqlite3cm
Docs 📄
from sqlite3cm import OpenSqlite3db
with OpenSqlite3db("database.db", throw_error=True) as (conn, cursor):
conn.execute('CREATE TABLE IF NOT EXISTS users')
Note:
You shouldn't forget about the parentisis after the as
Arguments
db_path
Path to the database (can be Pathlib
path) (default to "database.db")
throw_error
Weather you want to throw an error or not (default to True)
Note:
None of these arguments are required.
Lightness 🕊
THE SCRIPT IS ONLY 20 LINES LONG 😄 (50 with docstrings and comments)
Features 🧪
At the beggining, the script will connect to the database and create a cursor
At the end, the script will commit, close the connection and cursor
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sqlite3cm-0.0.3.tar.gz
.
File metadata
- Download URL: sqlite3cm-0.0.3.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
fb1f3659e20b2edc810c914f2690cf1d74778511608c590ea2926f49e3486082
|
|
MD5 |
61f1233f51b8a01481c86caf0d6a404a
|
|
BLAKE2b-256 |
509a517098ba1dbd14c7e7fa4f54315e69364eb5aea6ee3893c6805bc0ed3fbb
|
File details
Details for the file sqlite3cm-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: sqlite3cm-0.0.3-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
2f2b0735f5d270aa24172ddaf52a1f7cf037362315d958968d390884e09d28ce
|
|
MD5 |
2c663b336e2aead303ac94929551e956
|
|
BLAKE2b-256 |
08910a2fb7debc2e350bbbbbcac661a2aec8409f6f6ed78449425fe28785a581
|