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.7.tar.gz
(11.1 kB
view hashes)
Built Distribution
Close
Hashes for ConcurrentDatabase-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dedb9cafa55c33f0913be324ba84fead6c3a84e6ef4f727ff12ad89b970e5ad |
|
MD5 | f968134e3701e9040dcc48d5e6206a4f |
|
BLAKE2b-256 | 002fdd00388f78e2960b10cbbd042dc0977abc3e5249beda3dc55c38eb106b89 |