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.10.tar.gz
(11.3 kB
view hashes)
Built Distribution
Close
Hashes for ConcurrentDatabase-0.0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c575f8252b976040d70631383ce3b92af164354204ecbad9d777d26a515a7ff |
|
MD5 | 50a642ba2c05ddd0ce0adaa15d050b87 |
|
BLAKE2b-256 | 70639962f266f1fd7dd22500706cc007d283a60ea93fa8f77e92b92f13fdca88 |
Close
Hashes for ConcurrentDatabase-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a555f6003b3a017328fbf35f2882fdd8646d21b1706b9a032b34ff91b3bacadd |
|
MD5 | b9132539ed189ff49d01f6139153a8f9 |
|
BLAKE2b-256 | 0b9ebb2bc67cbe85326aec1a1f8e1ae11a3ea6d8f0a5fb0499c65205a777634b |