Exemplo n.º 1
0
def test_db(postgresql):
    import psycopg2
    from talisker.postgresql import TaliskerConnection

    with psycopg2.connect(postgresql.dsn) as ddl:
        with ddl.cursor() as cur:
            cur.execute("""
                CREATE TABLE IF NOT EXISTS test (
                id   INTEGER PRIMARY KEY,
                value TEXT
                );
            """)
            cur.execute("INSERT INTO test VALUES (1, 'foo')")

    return TaliskerConnection(postgresql.dsn)
Exemplo n.º 2
0
def conn(postgresql):
    return TaliskerConnection(postgresql.dsn)