Package trac :: Package db :: Module mysql_backend :: Class MySQLConnector

Class MySQLConnector

source code

    object --+    
             |    
core.Component --+
                 |
                MySQLConnector

Database connector for MySQL version 4.1 and greater.

Database URLs should be of the form:

{{{
mysql://user[:password]@host[:port]/database[?param1=value&param2=value]
}}}
The following parameters are supported:
Nested Classes

Inherited from core.Component: __metaclass__

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
get_supported_schemes(self) source code
 
get_connection(self, path, log=None, user=None, password=None, host=None, port=None, params={}) source code
 
get_exceptions(self) source code
 
init_db(self, path, schema=None, log=None, user=None, password=None, host=None, port=None, params={}) source code
 
to_sql(self, table, max_bytes=None) source code
 
alter_column_types(self, table, columns)
Yield SQL statements altering the type of one or more columns of a table.
source code
 
backup(self, dest_file) source code
 
environment_created(self) source code
 
environment_needs_upgrade(self, db) source code
 
upgrade_environment(self, db) source code

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

Static Methods

Inherited from core.Component: implements

Class Variables
  mysqldump_path = <Option [trac] "mysqldump_path">
  UNSUPPORTED_ENGINES = ('MyISAM', 'EXAMPLE', 'ARCHIVE', 'CSV', ...
  SUPPORTED_COLLATIONS = (('utf8mb4', 'utf8mb4_bin'), ('utf8mb3'...
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

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

alter_column_types(self, table, columns)

source code 

Yield SQL statements altering the type of one or more columns of a table.

Type changes are specified as a columns dict mapping column names to (from, to) SQL type tuples.


Class Variable Details

UNSUPPORTED_ENGINES

Value:
('MyISAM', 'EXAMPLE', 'ARCHIVE', 'CSV', 'ISAM')

SUPPORTED_COLLATIONS

Value:
(('utf8mb4', 'utf8mb4_bin'),
 ('utf8mb3', 'utf8_bin'),
 ('utf8', 'utf8_bin'))