Skip to main content

A SQLite wrapper that allows for object oriented database access.

Project description

Build Checks Upload Python Package

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


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.2.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

ConcurrentDatabase-0.0.2-py3-none-any.whl (9.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page