Skip to content

Commit b6cba32

Browse files
author
James William Pye
committed
Documentation work in release preparation.
1 parent 24a62d8 commit b6cba32

5 files changed

Lines changed: 50 additions & 13 deletions

File tree

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
Changes in v1.1
22
===============
33

4-
1.1.0 in development
5-
--------------------
4+
1.1.0
5+
-----
66

77
* Remove two-phase commit interfaces per deprecation in v1.0.
88
For proper two phase commit use, a lock manager must be employed that
99
the implementation did nothing to accommodate for.
1010
* Add support for unpacking anonymous records (Elvis)
1111
* Support PostgreSQL 9.2 (Elvis)
12+
* Python 3.3 Support (Elvis)
1213
* Add column execution method. (jwp)
13-
* Add one-shot statement interface. Connection.query (jwp)
14+
* Add one-shot statement interface. Connection.query.* (jwp)
15+
* Modify the inet/cidr support by relying on the ipaddress module introduced in Python 3.3 (Google's ipaddr project)
16+
The existing implementation relied on simple str() representation supported by the
17+
socket module. Unfortunately, MS Windows' socket library does not appear to support the
18+
necessary functionality, or Python's socket module does not expose it. ipaddress fixes
19+
the problem.
20+
21+
.. note::
22+
The `ipaddress` module is now required for local inet and cidr. While it is
23+
of "preliminary" status, the ipaddr project has been around for some time and
24+
well supported. ipaddress appears to be the safest way forward for native
25+
network types.

postgresql/documentation/driver.rst

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,14 +1208,27 @@ available when using queries as the results, or handle to the results, are direc
12081208

12091209
Queries have access to all execution methods:
12101210

1211-
``Connection.query(sql, *parameters)``
1212-
``Connection.query.rows(sql, *parameters)``
1213-
``Connection.query.column(sql, *parameters)``
1214-
``Connection.query.first(sql, *parameters)``
1215-
``Connection.query.chunks(sql, *parameters)``
1216-
``Connection.query.declare(sql, *parameters)``
1217-
``Connection.query.load_rows(sql, collections.Iterable(parameters))``
1218-
``Connection.query.load_chunks(collections.Iterable(collections.Iterable(parameters)))``
1211+
* ``Connection.query(sql, *parameters)``
1212+
* ``Connection.query.rows(sql, *parameters)``
1213+
* ``Connection.query.column(sql, *parameters)``
1214+
* ``Connection.query.first(sql, *parameters)``
1215+
* ``Connection.query.chunks(sql, *parameters)``
1216+
* ``Connection.query.declare(sql, *parameters)``
1217+
* ``Connection.query.load_rows(sql, collections.Iterable(parameters))``
1218+
* ``Connection.query.load_chunks(collections.Iterable(collections.Iterable(parameters)))``
1219+
1220+
In cases where a sequence of one-shot queries needs to be performed, it may be important to
1221+
avoid unnecessary repeat attribute resolution from the connection object as the ``query``
1222+
property is an interface object created on access. Caching the target execution methods is
1223+
recommended::
1224+
1225+
qrows = db.query.rows
1226+
l = []
1227+
for x in my_queries:
1228+
l.append(qrows(x))
1229+
1230+
The characteristic of Each execution method is discussed in the prior
1231+
`Prepared Statements`_ section.
12191232

12201233
Stored Procedures
12211234
=================

postgresql/documentation/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Reference
3131
:maxdepth: 2
3232

3333
bin
34-
modules
34+
reference
3535

3636
Changes
3737
-------

postgresql/temporal.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ class Temporal(object):
2424
>>> with pg_tmp:
2525
... ps = db.prepare('SELECT 1')
2626
... assert ps.first() == 1
27-
27+
2828
Or `pg_tmp` can decorate a method or function.
2929
"""
30+
31+
#: Format the cluster directory name.
3032
cluster_dirname = 'pg_tmp_{0}_{1}'.format
3133
cluster = None
34+
3235
_init_pid_ = None
3336
_local_id_ = 0
3437
builtins_keys = {

postgresql/test/test_driver.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,6 +1794,15 @@ def testQuery(self):
17941794
self.assertEqual(next(db.query.rows('select 1')), (1,))
17951795
self.assertEqual(db.query.declare('select 1').read(), [(1,)])
17961796

1797+
self.assertEqual(db.query('select $1::int', 1), [(1,)])
1798+
self.assertEqual(db.query.first('select $1::int', 1), 1)
1799+
self.assertEqual(next(db.query.column('select $1::int', 1)), 1)
1800+
self.assertEqual(next(db.query.rows('select $1::int', 1)), (1,))
1801+
self.assertEqual(db.query.declare('select $1::int', 1).read(), [(1,)])
1802+
1803+
self.assertEqual(db.query.load_rows('select $1::int', [[1]]), None)
1804+
self.assertEqual(db.query.load_chunks('select $1::int', [[[1]]]), None)
1805+
17971806
class test_typio(unittest.TestCase):
17981807
@pg_tmp
17991808
def testIdentify(self):

0 commit comments

Comments
 (0)