Revision 2643
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
328 | 328 |
if self.autocommit and self._savepoint == 0: |
329 | 329 |
self.log_debug('Autocommiting') |
330 | 330 |
self.db.commit() |
331 |
|
|
332 |
def col_default(self, col): |
|
333 |
table = sql_gen.Table('columns', 'information_schema') |
|
334 |
|
|
335 |
conds = [('table_name', col.table.name), ('column_name', col.name)] |
|
336 |
schema = col.table.schema |
|
337 |
if schema != None: conds.append(('table_schema', schema)) |
|
338 |
|
|
339 |
return value(select(self, table, ['column_default'], conds, |
|
340 |
order_by='table_schema', limit=1, log_level=3)) |
|
341 |
# TODO: order_by search_path schema order |
|
331 | 342 |
|
332 | 343 |
connect = DbConn |
333 | 344 |
|
Also available in: Unified diff
sql.py: DbConn: Added col_default()