Skip to content

Commit 1979d70

Browse files
author
James William Pye
committed
Minor updates, use postgresql.open().
1 parent ccf2653 commit 1979d70

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

README

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ Installation should be as simple as::
1717
$ python3.0 ./setup.py install
1818

1919

20-
Further information is available via: python -m postgresql.documentation.admin
20+
More information about installation is available via::
21+
22+
python -m postgresql.documentation.admin
2123

2224

2325
Basic Driver Usage
@@ -29,24 +31,20 @@ DB-API 2.0 driver is provided: `postgresql.driver.dbapi20`.
2931
Sample PG-API Code
3032
^^^^^^^^^^^^^^^^^^
3133

32-
import postgreql.driver as pg_driver
33-
34-
# Alter the parameters accordingly
35-
db = pg_driver.connect(user = 'myuser', host = 'localhost', port = 5432, database = 'mydbname', password = 'secret')
36-
37-
# create a prepared statement
38-
get_table = db.prepare("select * from information_schema.tables where table_name = $1")
39-
for x in get_table("tables"):
40-
print(x)
41-
print(get_table.first("tables"))
34+
>>> import postgresql
35+
>>> db = postgresql.open('pq://user:password@host:port/database')
36+
>>> get_table = db.prepare("select * from information_schema.tables where table_name = $1")
37+
>>> for x in get_table("tables"):
38+
>>> print(x)
39+
>>> print(get_table.first("tables"))
4240

4341

4442
Further Information
4543
-------------------
4644

47-
The documentation directory, `postgresql/documentation`, contains more detailed
48-
information on the modules herein, and HTML versions of the documentation can
49-
be found at::
45+
The documentation package, `postgresql.documentation.index`, contains more
46+
detailed information on the modules herein, and HTML versions of the
47+
documentation can be found at::
5048

5149
http://python.projects.postgresql.org
5250

0 commit comments

Comments
 (0)