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.8.tar.gz
(11.3 kB
view hashes)
Built Distribution
Close
Hashes for ConcurrentDatabase-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c86406ba753c611bc058ac6120aea004f8cd7864b458cb0139feb45b79566bff |
|
MD5 | ec49112b8130499085bb360eafbcee74 |
|
BLAKE2b-256 | 17796552777d175b55e84f63e0e38a2932263a5cc837734393938a0a1d3cd7f9 |