Package trac :: Package db :: Module mysql_backend :: Class MySQLConnection

Class MySQLConnection

source code

            object --+    
                     |    
    api.ConnectionBase --+
                         |
            object --+   |
                     |   |
util.ConnectionWrapper --+
                         |
                        MySQLConnection

Connection wrapper for MySQL.
Nested Classes

Inherited from api.ConnectionBase: __metaclass__

Instance Methods
 
__init__(self, path, log, user=None, password=None, host=None, port=None, params={})
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
cursor(self) source code
 
rollback(self) source code
 
close(self) source code
 
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_table_names(self)
Returns a list of the table names.
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
 
reset_tables(self)
Deletes all data from the tables and resets autoincrement indexes.
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)
Return the quoted identifier.
source code
 
update_sequence(self, cursor, table, column='id')
Updates the current value of the primary key sequence for table.
source code

Inherited from util.ConnectionWrapper: __call__, __getattr__, check_select, execute, executemany

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

Class Variables
  poolable = True
  __abstractmethods__ = frozenset([])
Properties

Inherited from util.ConnectionWrapper: cnx, log, readonly

Inherited from object: __class__

Method Details

__init__(self, path, log, user=None, password=None, host=None, port=None, params={})
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

cast(self, column, type)

source code 
Returns a clause casting column as type.
Overrides: api.ConnectionBase.cast
(inherited documentation)

concat(self, *args)

source code 
Returns a clause concatenating the sequence args.
Overrides: api.ConnectionBase.concat
(inherited documentation)

drop_column(self, table, column)

source code 
Drops the column from table.
Overrides: api.ConnectionBase.drop_column
(inherited documentation)

drop_table(self, table)

source code 
Drops the table.
Overrides: api.ConnectionBase.drop_table
(inherited documentation)

get_column_names(self, table)

source code 
Returns the list of the column names in table.
Overrides: api.ConnectionBase.get_column_names
(inherited documentation)

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.
Overrides: api.ConnectionBase.get_last_id
(inherited documentation)

get_table_names(self)

source code 
Returns a list of the table names.
Overrides: api.ConnectionBase.get_table_names
(inherited documentation)

like(self)

source code 
Returns a case-insensitive LIKE clause.
Overrides: api.ConnectionBase.like
(inherited documentation)

like_escape(self, text)

source code 
Returns text escaped for use in a LIKE clause.
Overrides: api.ConnectionBase.like_escape
(inherited documentation)

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.
Overrides: api.ConnectionBase.reset_tables
(inherited documentation)

prefix_match(self)

source code 
Return a case sensitive prefix-matching operator.
Overrides: api.ConnectionBase.prefix_match
(inherited documentation)

prefix_match_value(self, prefix)

source code 
Return a value for case sensitive prefix-matching operator.
Overrides: api.ConnectionBase.prefix_match_value
(inherited documentation)

quote(self, identifier)

source code 
Return the quoted identifier.
Overrides: api.ConnectionBase.quote

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.
Overrides: api.ConnectionBase.update_sequence
(inherited documentation)