pg8000 1.9.0 Released

Поиск
Список
Период
Сортировка
От Tony Locke
Тема pg8000 1.9.0 Released
Дата
Msg-id CAPpF0yOxuC4=1ghmsdZC8E4dCm64EQ-0gAWXhaaNgZRB2+j1NQ@mail.gmail.com
обсуждение исходный текст
Список pgsql-announce
Hi, I'm pleased to announce the release of pg8000 1.9.0, the
pure-Python PostgreSQL driver. It's available at:

https://pypi.python.org/pypi/pg8000/

and the docs are at:

http://pythonhosted.org/pg8000/

At the bottom of the email I've put a list of the changes since the
1.08 release, but the headlines are:

* Single codebase for Python 2 and 3.
* Lots of performance improvements.
* Many bug fixes.
* New data types.

Bug reports, feature requests and contributions are welcome at:

https://github.com/mfenniak/pg8000

And if you try it out, we'd really welcome your feedback!

Cheers,

Tony Locke.

Release Notes For 1.9.0
-----------------------------------

* For Python 3, the 'bytes' type replaces the pg8000.Bytea type. For
backward compatibility the pg8000.Bytea still works under Python 3,
but its use is deprecated.

* A single codebase for Python 2 and 3.

* Everything (functions, properties, classes) is now available under
the pg8000 namespace. So for example:

  * pg8000.DBAPI.connect() -> pg8000.connect()
  * pg8000.DBAPI.apilevel -> pg8000.apilevel
  * pg8000.DBAPI.threadsafety -> pg8000.threadsafety
  * pg8000.DBAPI.paramstyle -> pg8000.paramstyle
  * pg8000.types.Bytea -> pg8000.Bytea
  * pg8000.types.Interval -> pg8000.Interval
  * pg8000.errors.Warning -> pg8000.Warning
  * pg8000.errors.Error -> pg8000.Error
  * pg8000.errors.InterfaceError -> pg8000.InterfaceError
  * pg8000.errors.DatabaseError -> pg8000.DatabaseError

  The old locations are deprecated, but still work for backward compatibility.

* Lots of performance improvements.

  * Faster receiving of numeric types.
  * Query only parsed when PreparedStatement is created.
  * PreparedStatement re-used in executemany()
  * Use collections.deque rather than list for the row cache. We’re
adding to one end and removing from the other. This is O(n) for a list
but O(1) for a deque.
  * Find the conversion function and do the format code check in the
ROW_DESCRIPTION handler, rather than every time in the ROW_DATA
handler.
  * Use the ‘unpack_from’ form of struct, when unpacking the data row,
so we don’t have to slice the data.
  * Return row as a list for better performance. At the moment result
rows are turned into a tuple before being returned. Returning the rows
directly as a list speeds
    up the performance tests about 5%.
  * Simplify the event loop. Now the main event loop just continues
until a READY_FOR_QUERY message is received. This follows the
suggestion in the Postgres
    protocol docs. There’s not much of a difference in speed, but the
code is a bit simpler, and it should make things more robust.
  * Re-arrange the code as a state machine to give > 30% speedup.
  * Using pre-compiled struct objects. Pre-compiled struct objects are
a bit faster than using the struct functions directly. It also
hopefully adds to the readability of the
    code.
  * Speeded up _send. Before calling the socket ‘write’ method, we
were checking that the ‘data’ type implements the ‘buffer’ interface
(bytes or bytearray), but the
    check isn’t needed because ‘write’ raises an exception if data is
of the wrong type.

* Add facility for turning auto-commit on. This follows the suggestion
of funkybob to fix the problem of not be able to execute a command
such as ‘create database’ that must be executed outside a transaction.
Now you can do conn.autocommit = True and then execute ‘create
database’.

* Add support for the PostgreSQL uid type. Thanks to Rad Cirskis.

* Add support for the PostgreSQL XML type.

* Add support for the PostgreSQL enum user defined types.

* Fix a socket leak, where a problem opening a connection could leave
a socket open.

* Fix empty array issue. https://github.com/mfenniak/pg8000/issues/10

* Fix scale on numeric types. https://github.com/mfenniak/pg8000/pull/13

* Fix numeric_send. Thanks to Christian Hofstaedtler.


В списке pgsql-announce по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Prague PostgreSQL Developers Day 2014
Следующее
От: Dave Page
Дата:
Сообщение: FOSDEM PGDay and Devroom 2014 - CfP deadline looming!