Package trac :: Package db :: Module postgres_backend :: Class PostgreSQLConnector

Class PostgreSQLConnector

source code

    object --+    
             |    
core.Component --+
                 |
                PostgreSQLConnector

Database connector for PostgreSQL.

Database URLs should be of the form: {{{ postgres://user[:password]@host[:port]/database[?schema=my_schema] }}}

Nested Classes

Inherited from core.Component: __metaclass__

Instance Methods
 
__init__(self, compmgr, init=<function __init__ at 0x7f8a61c60140>, cls=<class 'trac.db.postgres_backend.PostgreSQLConnector'>)
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
 
init_db(self, path, log=None, user=None, password=None, host=None, port=None, params={}) source code
 
to_sql(self, table) 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

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

Static Methods

Inherited from core.Component: __new__, implements

Class Variables
  pg_dump_path = <Option [trac] "pg_dump_path">
Properties

Inherited from object: __class__

Method Details

__init__(self, compmgr, init=<function __init__ at 0x7f8a61c60140>, cls=<class 'trac.db.postgres_backend.PostgreSQLConnector'>)
(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.