Package picalo :: Module Database :: Class _MySQLdbConnection
[show private | hide private]
[frames | no frames]

Class _MySQLdbConnection

AbstractDecorator --+    
                    |    
          _Connection --+
                        |
                       _MySQLdbConnection


A specialization class for MySQLdb connections
Method Summary
  __init__(self, dbconnection, func, args)
  __repr__(self)
Returns a string representation of this connection
  list_tables(self, refresh)
Returns the table names in this database as a list
  _set_table_types(self, cursor, table)
Helper method for _Connection.table().
    Inherited from _Connection
  __getattr__(self, key)
Returns the given attribute of the class.
  __str__(self)
Returns a string representation of this connection
  commit(self)
Commits any changes to the database.
  copy_table(self, source_connection, source_tablename, dest_tablename, replace)
Copies a table from a database into this connection.
_Cursor cursor(self)
Returns a cursor to the database.
object execute(self, sql, parameters, close_cursor)
Runs executable queries (INSERT, UPDATE, DELETE) that don't return tables.
InsertQueryBuilder insert_query_builder(self, tablename)
This method returns a helper class for creating INSERT queries.
  is_changed(self)
Returns whether the connection needs saving
  post_table(self, table, name, replace, add_if_empty)
Creates a new table in the database and posts the records in the given table.
Cursor query(self, sql, parameters)
Runs a SELECT query that returns a result set.
Record query1(self, sql, parameters)
Runs a SELECT query and returns only the first record from the result set.
  refresh(self, tablename)
Refreshes the given table name, if it has already been pulled from the database.
  save(self, filename)
Saves the database connection
SelectQueryBuilder select_query_builder(self, tablename, select_fields)
This method returns a helper class for creating simple SELECT queries.
Table table(self, sql, parameters)
This method is the primary access to databases within Picalo.
UpdateQueryBuilder update_query_builder(self, tablename)
This method returns a helper class for creating simple UPDATE queries.
  _create_database_table(self, table, name, replace)
Creates a databaes relation matching the column names and types of the given table.
  _get_columns(self, tablename)
Returns a list of the columns in the given table
    Inherited from AbstractDecorator
  __cmp__(self, other)
  __delattr__(self, name)
  __eq__(self, other)
  __ge__(self, other)
  __gt__(self, other)
  __hash__(self)
  __le__(self, other)
  __lt__(self, other)
  __ne__(self, other)
  __nonzero__(self)
  __setattr__(self, name, value)

Class Variable Summary
    Inherited from _Connection
str QUERY_PARAMETER = '%s'

Method Details

__repr__(self)
(Representation operator)

Returns a string representation of this connection
Overrides:
picalo.Database._Connection.__repr__

list_tables(self, refresh=True)

Returns the table names in this database as a list
Overrides:
picalo.Database._Connection.list_tables

_set_table_types(self, cursor, table)

Helper method for _Connection.table(). After the query is run, this method uses the cursor to set the column types appropriately.
Overrides:
picalo.Database._Connection._set_table_types

Generated by Epydoc 2.1 on Mon Aug 20 05:38:17 2007 http://epydoc.sf.net