Exemple #1
0
def get_user_record(c, user_id):
    """
    Get user record from the database with the specified user ID.
    """
    if not has_table('user'):
        return None

    users = get_table('user')
    stmt = select([users]).where(users.c._id == user_id)
    result = c.execute(stmt)
    return result.fetchone()
Exemple #2
0
 def test_has_table_nonexistent(self):
     assert db.has_table('something') is False
Exemple #3
0
 def test_has_table(self):
     assert db.has_table('note') is True