Skip to main content

Basic sqlite3 wrapper write as short as a corgi legs and as fast as a corgi

Project description

CorgiDB

Write as short as Corgi's legs but and as fast as a Corgi

CorgiDB is a wrapper of python3's sqlite3 package

Installation

pip install corgidb

Full Documents

CorgiDB Module

The CorgiDB module provides standard accesss to a *.sqlite file and served as the starting point of using corgidb which can be used to access the Utils module of the library

from corgidb import CorgiDB
cdb = CorgiDB(database_path="path/to/db.sqlite")

CorgiDB.utils class

After we construct the CorgiDB class the objects provide us with many basic utilities function connect to the previously defined database connection

  • create_table(name: str, columns: list)
  • delete_table(name: str, keep_table: bool=False)
  • get_table(name: str)

create_table()

the create_table method will create table on the connected database

Arguments

  • name (str) The name of the table which cannot be duplicate and cannot be named "sqlite_sequence" as the name is being use for auto increment
  • columns (list) Table columns name and datatypes in tuple which can be int, float, bool, str

Return

  • This method will return a Table object which will later explained in this document
tb = cdb.utils.create_table(
    name="Personnel",
    columns=[
      (name, str)
      (age, int)
      (mobile, str)
      (height, float)])

delete_table()

the delete_table method will delete named table on the connected database

Arguments

  • name (str) The Table you wished to delete
  • keep_table (bool) delete only data but keep the table default is false
cdb.utils.delete_table(
  name="Personnel"
)

get_table()

similar to create_table but use with already created table to return Table objects

Arguments

  • name (str) The table you want to create table object

Return

  • This method will return a Table object which will later explained in this document
tb = cdb.utils.get_table(name="Personnel")

Table module

this is the class mentioned above that generate from get_table() and create_table() method

Methods

  • insert
  • update
  • remove
  • get

This document is incomplete <<<<<<< HEAD

8b6f01b84ba6f497468754cb0d03cf1955b135b9

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

corgidb-0.1.12.tar.gz (8.3 kB view hashes)

Uploaded Source

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