Esempio n. 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]))
Esempio n. 2
0
 def setUp(self):
     self.c = connect(database='postgres', engine='postgres')
Esempio n. 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))
Esempio n. 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)")