A SQLite wrapper that allows for object oriented database access.
Project description
ConcurrentDatabase
A simple sql wrapper for making a database be object oriented
Installation
pip install ConcurrentDatabase
Database Initialization
from ConcurrentDatabase.Database import Database
db = Database("test.db")
table = db.create_table("example_table", {
"id": "INTEGER PRIMARY KEY",
"name": "TEXT",
"location": "TEXT"
}, primary_keys=["id"])
Inserting Data
table = db.get_table("example_table")
table.add(name="Jay", location="USA")
table.add(name="John", location="USA")
Updating Data
table = db.get_table("example_table")
row = table.get_row(name="Jay")
row["name"] = "JayFromProgramming" # Changes are saved in memory until you call row.flush()
row.flush()
# or
row.set(name="JayFromProgramming") # Flushes immediately
Deleting Data
table = db.get_table("example_table")
row = table.get_row(name="Jay")
row.delete()
# or
table.delete(name="Jay")
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
ConcurrentDatabase-0.0.11.tar.gz
(11.4 kB
view hashes)
Built Distribution
Close
Hashes for ConcurrentDatabase-0.0.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8f0b6682414adb35289c670352bc1593f78e1afd9378cd939b32d0f19b4d44 |
|
MD5 | 1d68a0c1305e7ed8bde5219f433cdc46 |
|
BLAKE2b-256 | b6a55f82e5c31d4b89640db926e71134084b0d2383004cc43680c7a0a3e8b872 |
Close
Hashes for ConcurrentDatabase-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ca4a8f0317ec1b4c8f87589bb85741a2a01fc674b82b88ba8998908a7cea10a |
|
MD5 | 20e515afba6efff03bb5c1f54f4e8e34 |
|
BLAKE2b-256 | 2322cbb076a6f6aea25cf9941386652148da29542c688c67cccdbcec3e708dfb |