IPlugin
The IPlugin class is accessible via the sqlapi.interfaces module.
Attributes
Methods
f guess_sequence_name(table_name, id_name) ...
Guess the name of the sequence for the given table and id name.
f activate_exceptions() ...
Called after activate(), and makes sure that the exceptions raised by the database inherit from the exceptions in sqlapi.exceptions
f parse_uri(uri) ...
Return a dictionary representation of the URI, as documented in sqlapi.uri.parse_uri
f sql_literal(value) ...
This will only be called rendering the expression to string, which shouldn't happen except for logging or debugging output (it should not be sent to the database).
f sql_literal_param(value) ...
This can be used to convert a Python object to an object that is accepted as a parameter by the database driver.
Most object do not need modification, but some database drivers do not like some kinds of objects.
f sql_quote_symbol(sym) ...
This is a generic implementation of quoting that applies to tables and columns (if those methods are overridden).
f sql_operator(oper) ...
This takes as an argument a string operator, which should be the ANSI SQL operator. It then returns the operator to actually be used.
f sql_column_create(name, type, params, default) ...
Returns one line/column as you'd expect in a CREATE TABLE statement. name is the column name. type is a standard SQL string representing the type (e.g., 'INT'). params is a dictionary of arguments. default is the caller's guess at the result.
Raise NotSupportedError if the database specifically does not support the column type. Return default if you simply do not know about the column type (and then the caller can guess).
f param_mark_generator() ...
Yield a sequence of (param_mark, param_name). If positional parameters are used, then return None for param_name, otherwise return a name used in a dictionary.
See the source for more information.