Minimal universal database connection library for SQLite, PostgreSQL and MySQL
Project description
multidb
A minimal universal database connection library for SQLite, PostgreSQL, MySQL.
One simple function to connect to multiple databases without worrying about different drivers.
First, install the library (after building or from PyPI once published):
pip install multidb
How to use this library and connect to different databases with examples: 1.Import the connect function.
from multidb import connect
2.To Connect to SQLite: conn = connect( "sqlite", database="my_database.db" # optional, defaults to ":memory:" )
3.Connect to PostgreSQL
Option A: Using individual parameters
conn = connect( "postgres", host="localhost", user="postgres", password="mypassword", database="testdb", port=5432 # optional, default is 5432 )
Option B: Using a URL
conn = connect( "postgres", url="postgresql://username:password@host:port/database" )
Connect to MySQL conn = connect( "mysql", host="localhost", user="root", password="mypassword", database="testdb", port=3306 # optional, default is 3306 )
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multidb-0.1.4.tar.gz.
File metadata
- Download URL: multidb-0.1.4.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18b62d15e473ced4a47bbc4796c638c6cc4ef7f5729ba154f5ba3981d7f73738
|
|
| MD5 |
5f759c38ee15e44a23ae7fc1e88c4f22
|
|
| BLAKE2b-256 |
b3dcf0a93318c681e5b3a68ffce282bb157500cfd5567c55a904ee150852644b
|
File details
Details for the file multidb-0.1.4-py3-none-any.whl.
File metadata
- Download URL: multidb-0.1.4-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a629d471db6d51000ecb03c2d39230501353fc919a2653b0b4260ce198524be
|
|
| MD5 |
6213f209cb412f50a8546d1fef0ae1ee
|
|
| BLAKE2b-256 |
d889d8f50f6cd1fc7a21d431697b3487293ff32b66d28b183c004d873a54b535
|