Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multidb-0.1.4.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multidb-0.1.4-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

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

Hashes for multidb-0.1.4.tar.gz
Algorithm Hash digest
SHA256 18b62d15e473ced4a47bbc4796c638c6cc4ef7f5729ba154f5ba3981d7f73738
MD5 5f759c38ee15e44a23ae7fc1e88c4f22
BLAKE2b-256 b3dcf0a93318c681e5b3a68ffce282bb157500cfd5567c55a904ee150852644b

See more details on using hashes here.

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

Hashes for multidb-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3a629d471db6d51000ecb03c2d39230501353fc919a2653b0b4260ce198524be
MD5 6213f209cb412f50a8546d1fef0ae1ee
BLAKE2b-256 d889d8f50f6cd1fc7a21d431697b3487293ff32b66d28b183c004d873a54b535

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page