IPlugin


Attributes

a module

'the DB-API module'

a movethread

'can connections move threads?'

a threadsafety

'according to DB-API'

a paramstyle

'according to DB-API'

a auto_increment

'If the database uses AUTO_INCREMENT, this is true'

a pool

'\n    Instance that has .connection() method that returns pooled\n    connections\n    '

Methods

f __init__() ...

Create an instance of the plugin, bound to connection parameters and options.

f tables(cursor) ...

Return a list of table names, using the given cursor object

f table_exists(tablename, cursor) ...

Does tablename exist in the database?

f get_sequence_nextval(sequence_name, cursor) ...

Get the next value for the named sequence

f guess_sequence_name(table_name, id_name) ...

Guess the name of the sequence for the given table and id name.

f activate() ...

Called the first time this plugin is loaded. Will not be called twice.

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 raw_connection() ...

Return the DB-API connection.

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_table(tablename) ...

This returns a table name with any necessary quoting for a database.

f sql_column(column) ...

This returns a column name with any necessary quoting for a database.

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_unary_operator(oper) ...

This takes a unary operator, like - meaning negation

f sql_postfix_operator(oper) ...

Takes an operator (-like thing), like 'IS NULL'

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 sql_function(function_name) ...

Takes a function name, like 'COUNT'

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.