| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
py-postgresql is a Python 3 package providing modules for working with PostgreSQL. Primarily, a high-level driver for querying databases.
While py-postgresql is still usable for many purposes, asyncpg and PostgREST are likely more suitable for most applications:
py-postgresql, currently, does not have direct support for high-level async interfaces provided by recent versions of Python. Future versions may change this.
In v2.0, many, potentially breaking, changes are planned. If you have automated installations using PyPI, make sure that they specify a major version.
From PyPI using pip:
python3 -m pip install py-postgresqlFrom GitHub using a full clone:
git clone https://github.com/python-postgres/fe.git
cd fe
python3 ./setup.py installimport postgresql
db = postgresql.open('pq://user:password@host:port/database')
get_table = db.prepare("SELECT * from information_schema.tables WHERE table_name = $1")
print(get_table("tables"))
# Streaming, in a transaction.
with db.xact():
for x in get_table.rows("tables"):
print(x)REPL with connection bound to db builtin:
python3 -m postgresql.bin.pg_python -I 'pq://postgres@localhost:5423/postgres'| Back | FazBrowse Home | New Git URL |