Project

General

Profile

« Previous | Next » 

Revision 1929

sql.py: pkey(): Fixed bug where queries were not being cached. Use select() instead of run_query() so that caching is automatically turned on and table names are automatically escaped.

View differences:

sql.py
330 330
def pkey(db, table, recover=None):
331 331
    '''Assumed to be first column in table'''
332 332
    check_name(table)
333
    return col_names(run_query(db,
334
        'SELECT * FROM '+table+' LIMIT 0', recover=recover)).next()
333
    return col_names(select(db, table, limit=0, recover=recover)).next()
335 334

  
336 335
def index_cols(db, table, index):
337 336
    '''Can also use this for UNIQUE constraints, because a UNIQUE index is

Also available in: Unified diff