Project

General

Profile

« Previous | Next » 

Revision 7113

sql.py: create_table(): Support creating a table like a view

View differences:

lib/sql.py
1475 1475
        str_ += '\n, '.join(c.to_str(db) for c in cols)
1476 1476
        str_ += '\n);'
1477 1477
        
1478
        run_query(db, str_, recover=True, cacheable=True, log_level=2,
1478
        opts = dict(recover=True, cacheable=True, log_level=2,
1479 1479
            log_ignore_excs=(DuplicateException,))
1480
        try: run_query(db, str_, **opts)
1481
        except InvalidTypeException: # try again as view
1482
            run_query_into(db, mk_select(db, like, limit=0), into=table, **opts)
1480 1483
    if table.is_temp:
1481 1484
        while True:
1482 1485
            try:

Also available in: Unified diff