webdb.adapter¶
webdb.adapter.abc¶
-
class
webdb.adapter.abc.AbstractDB¶ Abstract base class for Databases.
-
close(*args)¶ Clean up the database after usage. Close sockets/files, …
-
handle_request(request, inject=None, inject_as=None)¶ Handle a request. Inject
injectifinject_ashas a value that can be interpreted as True. Commit changes if necessary.Return the result (any JSON seriaziable) or raise an exception.
-
open(*args)¶ Bring this database in a state where it can execute queries.
-
-
class
webdb.adapter.abc.AbstractDBMS¶ Abstract base class for all DBMS backends.
-
dispatch_DB(db_name)¶ Try to connect to this database. Return a new AbstractDB instance. This DB should not be opened yet (
openwill be called later).Note: A DBMS might manage several different DBs.
-
handle_request(request)¶ Handle a request and return the result. The result might be an exception or any kind of data that can be JSON serialized.
-
webdb.adapter.abstractsql¶
-
class
webdb.adapter.abstractsql.AbstractSQLDB¶ An abstract SQL DB adapter. The following methods must be overwritten:
open,close,get_column_names,get_table_names.-
get_column_names(table)¶ Return a list with the column names in this table.
-
get_table_names()¶ Return a list of table names in this database.
-
handle_request(request, inject=None, inject_as=None)¶ Handle a request. Inject
injectifinject_ashas a value that can be interpreted as True. Commit changes if necessary.Return the result (any JSON seriaziable) or raise an exception.
-
webdb.adapter.sqlite¶
-
class
webdb.adapter.sqlite.SqliteDB(filename)¶ SQLite3 adapter.
The constuctor requires the filename of the database file.
-
close()¶ Clean up the database after usage. Close sockets/files, …
-
get_column_names(table)¶ Return a list with the column names in this table.
-
get_table_names()¶ Return a list of table names in this database.
-
open()¶ Bring this database in a state where it can execute queries.
-
-
class
webdb.adapter.sqlite.SqliteDBMS(path, filenames, inject=None, inject_as=None)¶ DBMS for SQLite files. All databases are files under
path.-
dispatch_DB(db_name)¶ Try to connect to this database. Return a new AbstractDB instance. This DB should not be opened yet (
openwill be called later).Note: A DBMS might manage several different DBs.
-
webdb.adapter.exceptions¶
-
exception
webdb.adapter.exceptions.DataError¶
-
exception
webdb.adapter.exceptions.DatabaseError¶
-
exception
webdb.adapter.exceptions.Error¶
-
exception
webdb.adapter.exceptions.IntegretyError¶
-
exception
webdb.adapter.exceptions.InterfaceError¶
-
exception
webdb.adapter.exceptions.NotSupportedError¶
-
exception
webdb.adapter.exceptions.OperationalError¶
-
exception
webdb.adapter.exceptions.ProgrammingError¶