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

Class SelectQueryBuilder

_BaseQueryBuilder --+
                    |
                   SelectQueryBuilder


Helps in building a simple select SQL call. This class is useful when creating SQL from a script, piece by piece. See _Connection.select_query_builder() for more information.
Method Summary
  __init__(self, tablename, select_fields, connection)
  get_parameters(self)
Returns the parameters as they will be sent to the database
  get_query_string(self)
Returns the query string as it will be sent to the database.
  query(self)
Runs the query and returns a cursor to the results data set
  query1(self)
Runs the query and returns a single record (i.e.
  table(self)
Runs the query and returns a Picalo table containing the results of the query.
    Inherited from _BaseQueryBuilder
  __getitem__(self, field)
Returns the item with the given field name
  __len__(self)
Returns the number of fields in this query
  __setitem__(self, field, value)
Allows dictionary-use of the object to call the add method.
  __str__(self)
  add(self, field, value, add_if_empty)
Adds a field/value pair to the statement, optionally skipping the add if the value is None or empty ('').
  add_where(self, field, value, add_if_empty)
Adds a field/value pair to the statement for the WHERE clause.
  execute(self)
Executes the SQL statement.
  get(self, field, default)
Returns the item with the given field name, or the default value if none exists

Method Details

get_parameters(self)

Returns the parameters as they will be sent to the database
Overrides:
picalo.Database._BaseQueryBuilder.get_parameters

get_query_string(self)

Returns the query string as it will be sent to the database.
Overrides:
picalo.Database._BaseQueryBuilder.get_query_string

query(self)

Runs the query and returns a cursor to the results data set

query1(self)

Runs the query and returns a single record (i.e. tuple) of the first result. This is useful when you are sure you will get only one result back from the query (such as a COUNT operator).

table(self)

Runs the query and returns a Picalo table containing the results of the query.

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