pyroxide.util.sqlparser (version , )
index
/usr/lib/python2.4/site-packages/pyroxide/util/sqlparser.py

The Limited SQL Parser.
 
This module provides methods to parse a SQL 'create table' statement.

 
Classes
       
CreateTableParser
TableDefinition

 
class CreateTableParser
     Methods defined here:
__init__(self, dbType, buffer)
Initialize the parser with the database type.
 
The dbType refers to the database syntax.  The valid options are either
'MySQL', 'Oracle', 'PostgreSQL', or 'SQLite'
columnDefinition(self)
createDefinition(self)
expect(self, token)
getToken(self)
match(self, token)
matchBracket(self)
parse(self)
primaryKey(self)
statement(self)
tableConstraint(self)

 
class TableDefinition
     Methods defined here:
__init__(self)

 
Data
        CLOSED_BRACKET = ')'
COMMA = ','
CREATE = 'create'
END = ';'
EXISTS = 'exists'
IF = 'if'
KEY = 'key'
MYSQL = 'MySQL'
MYSQL_TABLE_CONSTRAINTS = ('constraint', 'index', 'key', 'unique', 'fulltext', 'spatial', 'foreign', 'check', 'primary')
NOT = 'not'
NULL = 'null'
OPEN_BRACKET = '('
ORACLE = 'Oracle'
ORACLE_TABLE_CONSTRAINTS = ('constraint', 'scope', 'with', 'ref')
POSTGRESQL = 'PostgreSQL'
POSTGRESQL_TABLE_CONSTRAINTS = ('constraint', 'unique', 'foreign', 'check', 'deferrable', 'not', 'initially', 'primary')
PRIMARY = 'primary'
SQLITE = 'SQLite'
SQLITE_TABLE_CONSTRAINTS = ('unique', 'check', 'primary')
TABLE = 'table'
UNIQUE = 'unique'
__HeadURL__ = '$URL$'
__LastChangedBy__ = '$Author$'
__LastChangedDate__ = '$Date$'
__Revision__ = '$Rev$'
__author__ = 'Kevin J. Smith (kevin@rootsmith.ca)'
__copyright__ = '(c) 2007 rootsmith Inc.'
__credits__ = ''
__date__ = ''
__version__ = ''

 
Author
        Kevin J. Smith (kevin@rootsmith.ca)

 
Credits