dblite  1.3.0
Simple query interface for SQL databases
dblite.engines.sqlite Namespace Reference

Classes

class  Database
 Convenience wrapper around sqlite3.Connection. More...
 
class  Queryable
 
class  Transaction
 Transaction context manager, breakable by raising Rollback. More...
 

Functions

def autodetect (opts)
 Returns true if input is recognizable as SQLite connection options. More...
 
def quote (value, force=False)
 Returns identifier in quotes and proper-escaped for queries, if value needs quoting (has non-alphanumerics, starts with number, or is reserved). More...
 
def register_adapter (transformer, typeclasses)
 Registers function to auto-adapt given Python types to SQLite types in query parameters. More...
 
def register_converter (transformer, typenames)
 Registers function to auto-convert given SQLite types to Python types in query results. More...
 
def register_row_factory (row_factory)
 Registers custom row factory, as or `None` to reset to default. More...
 

Variables

list RESERVED_KEYWORDS
 SQLite reserved keywords, needing quotes in SQL queries. More...
 

Function Documentation

◆ autodetect()

def dblite.engines.sqlite.autodetect (   opts)

Returns true if input is recognizable as SQLite connection options.

Parameters
optsexpected as a path string or path-like object

Definition at line 574 of file sqlite.py.

◆ quote()

def dblite.engines.sqlite.quote (   value,
  force = False 
)

Returns identifier in quotes and proper-escaped for queries, if value needs quoting (has non-alphanumerics, starts with number, or is reserved).

Parameters
valuethe value to quote, returned as-is if not string
forcewhether to quote value even if not required

Definition at line 590 of file sqlite.py.

◆ register_adapter()

def dblite.engines.sqlite.register_adapter (   transformer,
  typeclasses 
)

Registers function to auto-adapt given Python types to SQLite types in query parameters.

Definition at line 600 of file sqlite.py.

◆ register_converter()

def dblite.engines.sqlite.register_converter (   transformer,
  typenames 
)

Registers function to auto-convert given SQLite types to Python types in query results.

Definition at line 605 of file sqlite.py.

◆ register_row_factory()

def dblite.engines.sqlite.register_row_factory (   row_factory)

Registers custom row factory, as or `None` to reset to default.

Definition at line 610 of file sqlite.py.

Variable Documentation

◆ RESERVED_KEYWORDS

list dblite.engines.sqlite.RESERVED_KEYWORDS
Initial value:
1 = [
2  "ACTION", "ADD", "AFTER", "ALL", "ALTER", "ALWAYS", "ANALYZE", "AND", "AS", "ASC", "ATTACH",
3  "AUTOINCREMENT", "BEFORE", "BEGIN", "BETWEEN", "BY", "CASE", "CAST", "CHECK", "COLLATE",
4  "COMMIT", "CONSTRAINT", "CREATE", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP",
5  "DEFAULT", "DEFERRABLE", "DEFERRED", "DELETE", "DESC", "DETACH", "DISTINCT", "DO", "DROP",
6  "EACH", "ELSE", "END", "ESCAPE", "EXCEPT", "EXISTS", "EXPLAIN", "FOR", "FOREIGN", "FROM",
7  "GENERATED", "GROUP", "HAVING", "IF", "IMMEDIATE", "IN", "INDEX", "INITIALLY", "INSERT",
8  "INSTEAD", "INTERSECT", "INTO", "IS", "ISNULL", "JOIN", "KEY", "LIKE", "LIMIT", "MATCH",
9  "NO", "NOT", "NOTHING", "NOTNULL", "NULL", "OF", "ON", "OR", "ORDER", "OVER", "PRAGMA",
10  "PRECEDING", "PRIMARY", "RAISE", "RECURSIVE", "REFERENCES", "REGEXP", "REINDEX", "RELEASE",
11  "RENAME", "REPLACE", "RESTRICT", "ROLLBACK", "SAVEPOINT", "SELECT", "SET", "TABLE",
12  "TEMPORARY", "THEN", "TIES", "TO", "TRANSACTION", "TRIGGER", "UNBOUNDED", "UNION",
13  "UNIQUE", "UPDATE", "USING", "VACUUM", "VALUES", "VIEW", "WHEN", "WHERE", "WITHOUT"
14 ]

SQLite reserved keywords, needing quotes in SQL queries.

Definition at line 31 of file sqlite.py.