blob: 1971e04d09efa6ec00c333d3049a1555f599391c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
from sqlplain import connect, do
def test_postgres():
count_customers = do('select count(*) from customer', scalar=True)
conn = connect('postgres://python:p1tone@localhost/rcare')
print count_customers(conn)
conn._curs.close() # closed the cursor by hand to emulate an error
print count_customers(conn)
def test_mssql():
count_customers = do('select count(*) from client', scalar=True)
conn = connect('srs_dev')
print count_customers(conn)
conn._curs.close() # closed the cursor by hand to emulate an error
print count_customers(conn)
if __name__ == '__main__':
test_mssql()
|