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
Built Distribution
Close
Hashes for ConcurrentDatabase-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c67b40e62238597e4cc6219f3ce2b26074902c4bdc15cb225ac7726e45d520d |
|
MD5 | 77f37b11dffced24044395a159c2cbfc |
|
BLAKE2b-256 | 2d6bb4f10f4451c49a5059f78b22ebca5a9f2e5ee9a09c9e9d99d3932cad95af |