Project

General

Profile

« Previous | Next » 

Revision 3247

sql.py: Added drop() and use it in drop_table()

View differences:

lib/sql.py
1178 1178

  
1179 1179
### Lifecycle
1180 1180

  
1181
def drop_table(db, table):
1182
    table = sql_gen.as_Table(table)
1183
    return run_query(db, 'DROP TABLE IF EXISTS '+table.to_str(db)+' CASCADE')
1181
def drop(db, type_, name):
1182
    name = sql_gen.as_Name(name)
1183
    run_query(db, 'DROP '+type_+' IF EXISTS '+name.to_str(db)+' CASCADE')
1184 1184

  
1185
def drop_table(db, table): drop(db, 'TABLE', table)
1186

  
1185 1187
def create_table(db, table, cols=[], has_pkey=True, col_indexes=True,
1186 1188
    like=None):
1187 1189
    '''Creates a table.

Also available in: Unified diff