Package trac :: Package db :: Module api :: Class ConnectionBase

Class ConnectionBase

source code

object --+
         |
        ConnectionBase
Known Subclasses:

Abstract base class for database connection classes.
Nested Classes
  __metaclass__
Metaclass for defining Abstract Base Classes (ABCs).
Instance Methods
 
cast(self, column, type)
Returns a clause casting column as type.
source code
 
concat(self, *args)
Returns a clause concatenating the sequence args.
source code
 
drop_column(self, table, column)
Drops the column from table.
source code
 
drop_table(self, table)
Drops the table.
source code
 
get_column_names(self, table)
Returns the list of the column names in table.
source code
 
get_last_id(self, cursor, table, column='id')
Returns the current value of the primary key sequence for table.
source code
 
get_sequence_names(self)
Returns a list of the sequence names.
source code
 
get_table_names(self)
Returns a list of the table names.
source code
 
has_table(self, table)
Returns whether the table exists.
source code
 
like(self)
Returns a case-insensitive LIKE clause.
source code
 
like_escape(self, text)
Returns text escaped for use in a LIKE clause.
source code
 
prefix_match(self)
Return a case sensitive prefix-matching operator.
source code
 
prefix_match_value(self, prefix)
Return a value for case sensitive prefix-matching operator.
source code
 
quote(self, identifier)
Returns the quoted identifier.
source code
 
reset_tables(self)
Deletes all data from the tables and resets autoincrement indexes.
source code
 
update_sequence(self, cursor, table, column='id')
Updates the current value of the primary key sequence for table.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  __abstractmethods__ = frozenset(['cast', 'concat', 'drop_colum...
Properties

Inherited from object: __class__

Method Details

cast(self, column, type)

source code 
Returns a clause casting column as type.
Decorators:
  • @abstractmethod

concat(self, *args)

source code 
Returns a clause concatenating the sequence args.
Decorators:
  • @abstractmethod

drop_column(self, table, column)

source code 
Drops the column from table.
Decorators:
  • @abstractmethod

drop_table(self, table)

source code 
Drops the table.
Decorators:
  • @abstractmethod

get_column_names(self, table)

source code 
Returns the list of the column names in table.
Decorators:
  • @abstractmethod

get_last_id(self, cursor, table, column='id')

source code 
Returns the current value of the primary key sequence for table. The column of the primary key may be specified, which defaults to id.
Decorators:
  • @abstractmethod

get_sequence_names(self)

source code 
Returns a list of the sequence names.
Decorators:
  • @abstractmethod

get_table_names(self)

source code 
Returns a list of the table names.
Decorators:
  • @abstractmethod

has_table(self, table)

source code 
Returns whether the table exists.
Decorators:
  • @abstractmethod

like(self)

source code 
Returns a case-insensitive LIKE clause.
Decorators:
  • @abstractmethod

like_escape(self, text)

source code 
Returns text escaped for use in a LIKE clause.
Decorators:
  • @abstractmethod

prefix_match(self)

source code 
Return a case sensitive prefix-matching operator.
Decorators:
  • @abstractmethod

prefix_match_value(self, prefix)

source code 
Return a value for case sensitive prefix-matching operator.
Decorators:
  • @abstractmethod

quote(self, identifier)

source code 
Returns the quoted identifier.
Decorators:
  • @abstractmethod

reset_tables(self)

source code 
Deletes all data from the tables and resets autoincrement indexes.
Returns:
list of names of the tables that were reset.
Decorators:
  • @abstractmethod

update_sequence(self, cursor, table, column='id')

source code 
Updates the current value of the primary key sequence for table. The column of the primary key may be specified, which defaults to id.
Decorators:
  • @abstractmethod

Class Variable Details

__abstractmethods__

Value:
frozenset(['cast',
           'concat',
           'drop_column',
           'drop_table',
           'get_column_names',
           'get_last_id',
           'get_sequence_names',
           'get_table_names',
...