大型项目中 postgres(PG)以及连接池 pool 的使用,增删改查模块高度的封装,自动提交、事务、回滚、详细使用介绍,文章有点长。
定义可以配置的连接参数:
# Postgres
Config.PostgresHost = Env.str('PostgresHost', '127.0.0.1')
Config.PostgresPort = Env.int('PostgresPort', 5432)
Config.PostgresUser = Env.str('PostgresUser', 'postgres'