###创建连接

详细config配置参见官方文档Connection Keywords部分
1
2
3
4
5
6
7
8
config = {
'user': 'username',
'password': 'password',
'host': 'localhost',
'port': 5432,
'database': 'postgres'
}
db = pg_driver.connect(**config)