pgwire 0.38.3

Postgresql wire protocol implemented as a library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
import psycopg2

conn = psycopg2.connect("host=127.0.0.1 port=5432 user=tom password=pencil dbname=localdb")
conn.autocommit = True

with conn.cursor() as cur:
    cur.execute("INSERT INTO testtable VALUES (1)")
    print(cur.statusmessage)

with conn.cursor() as cur:
    cur.execute("SELECT * FROM testtable")
    print(cur.fetchall())