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.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f56153dedb2b68d23a7d58b4a80551e8c466d34257484f7e3b4a1526cea1ef2 |
|
MD5 | 637a7b657ad91e65f701c1bc9929b15e |
|
BLAKE2b-256 | e4aeda5bb78940ad51b293b926b579a3b81f5b642b61a1dce69423a9fccf2464 |