[Driver]: SQLite

A driver for SQLite databases.

Version & Informations

Driver_SQLite.version = '0.1.0'

Dependencies

  • sqlite3 (Python Built-in)

Subclasses / Methods

Driver_SQLite.payload = '?'
MercurySQL.drivers.sqlite.Driver_SQLite.Conn

alias of Connection

class MercurySQL.drivers.sqlite.Driver_SQLite.Cursor

SQLite database cursor class.

class MercurySQL.drivers.sqlite.Driver_SQLite.APIs
class gensql
static add_column(table_name: str, column_name: str, column_type: str) str
static create_table_if_not_exists(table_name: str, column_name: str, column_type: str, primaryKey=False, autoIncrement=False) str
static delete(table_name: str, condition: str) str
static drop_column(table_name: str, column_name: str) str
static drop_table(table_name: str) str
static get_all_columns(table_name: str) str
static get_all_tables() str
static insert(table_name: str, columns: str, values: str) str
static insert_or_update(table_name: str, columns: str, values: str) str
static query(table_name: str, selection: str, condition: str) str
static set_primary_key(table, keyname: str, keytype: str) list
static update(table_name: str, columns: str, condition: str) str
classmethod get_all_columns(db, table_name: str) List[str]
classmethod get_all_tables(db) List[str]
class MercurySQL.drivers.sqlite.Driver_SQLite.TypeParser

Parse the type from Python Type -> SQL Type.

static parse(type_: Any) str

Compile the type to SQLite type.

Parameters:

type (Any) – The type to parse.

Returns:

The SQLite type.

Return type:

str

Supported Types

SQLite Type

str

TEXT

int

INTEGER

float

REAL

bool

BOOLEAN

bytes

BLOB

Example Usage:

TypeParser.parse(str)       # TEXT
TypeParser.parse(int)       # INTEGER
TypeParser.parse(float)     # REAL
...