Пример #1
0
 def __init__(self, *args, **kwargs):
     self.con = connect(*args, **kwargs)
     for table in self.con.tables():
         # Better than overriding __getattr__(), because we get tab completion
         setattr(self, table[0], T(self.con, table[0]))
Пример #2
0
 def setUp(self):
     self.c = connect(database='postgres', engine='postgres')
Пример #3
0
def check_connection_rule(args, kwargs, engine):
    c = connect(*args, **kwargs)
    if engine == 'sqlite':
        assert_true(isinstance(c, SQLiteConnection))
    else:
        assert_true(isinstance(c, PostgresqlConnection))
Пример #4
0
 def setUp(self):
     self.c = connect(database=':memory:', engine='sqlite')
     self.c("CREATE TABLE people (id, name)")
     self.c("CREATE TABLE books (id, author, title)")