Commit Graph

23 Commits

Author SHA1 Message Date
Daniele Varrazzo
2b554937f2 Dropped __all__ from modules
They were only used to generate docs with Epydoc, now largely forgotten.

Imports in extras cleaned up to expose the API only.
2013-04-07 02:59:30 +01:00
Daniele Varrazzo
9e15f54fe8 Added cursor_factory connection attribute and connect() parameter 2013-04-07 02:30:12 +01:00
Daniele Varrazzo
b6873ee1ab Dropped support for Python 2.4 2013-03-20 23:40:13 +00:00
Daniele Varrazzo
20d3d0f66d Raise TypeError instead of InterfaceError on bad params on connect()
TypeError is the standard Python error raised in this case:

    $ python -c "(lambda a: None)(b=10)"
    TypeError: <lambda>() got an unexpected keyword argument 'b'

We only used to raise InterfaceError when connect was used without
any parameter at all, so it's hard to think a program depending on
that design. Furthermore the function has always raised (and still
does) OperationalError too, if the bad argument is detected by the
libpq, and that cannot be changed because we can't tell the
difference from a normal connection error.
2012-09-26 11:55:21 +01:00
Daniele Varrazzo
cf3c6f86ff Improved error message on connect when kwargs are passed together with dns 2012-09-26 11:47:06 +01:00
Daniele Varrazzo
cd316a94f1 Dropped quirks in connection arguments handling
Now connect() raises an exception instead of swallowing keyword arguments
when a connection string is specified as well

Closes ticket #131.
2012-09-25 23:46:46 +01:00
Daniele Varrazzo
e18d27c475 Reproducing/documenting odd behaviours of connect() 2011-11-17 21:51:24 +00:00
Daniele Varrazzo
625cc1b402 Escape parameters to the connection strings as required by PQconnectdb 2011-11-17 21:51:24 +00:00
Daniele Varrazzo
d2b67364fd connect() supports generic keyword arguments passed to the dsn 2011-11-17 01:51:25 +00:00
Daniele Varrazzo
dde4c0de3d Decimal adapter registration moved from C to Python
Fixes Decimal adaptation in sub-interpreter, where the Decimal class has
a different identity from the one in the main interpreter.

Closes ticket #52.
2011-10-14 22:35:56 +01:00
Daniele Varrazzo
62a8ef308a Fixed version check 2011-06-04 14:21:18 +01:00
Daniele Varrazzo
1ba5f104c9 Import _psycopg as the first module in the package
Failing to do so, the real cause of the _psycopg import failed may get
hidden and people may get a misleading error such as "cannot import name
tz" instead.
2011-02-17 10:45:18 +00:00
Daniele Varrazzo
ac5cde8834 Only use absolute imports in the package
In Python 3.2b2 the relative imports are not converted into explicit
ones (with .).
2011-01-08 01:24:28 +00:00
Daniele Varrazzo
fdfa2de1a1 Fixed adaptation of None in composite types (ticket #26).
Added an adapter for None: it is usually not invoked as adaptation to
NULL is a fast path in mogrify, but can be invoked by composite types.
Notice that composite types still have the option to fast-path None
(e.g. list adapter does).
2011-01-01 17:07:54 +01:00
Daniele Varrazzo
0dbe068df4 Stop the loop variable used to create __all__ leaking in the module. 2010-02-14 00:35:47 +01:00
Federico Di Gregorio
a9673f31d6 SQL_IN adapter is now automatically registered 2010-02-13 00:40:29 +01:00
Federico Di Gregorio
611606d532 Changes license to LGPL3 + OpenSSL exception on all source files 2010-02-12 23:34:53 +01:00
Daniele Varrazzo
202c002c5c * Docstrings added/fixed
* Added __all__ attributes to Python modules to explicit the package API
2006-01-12 18:36:57 +00:00
Federico Di Gregorio
13a1dd197c Added warnings. 2005-11-15 16:21:55 +00:00
Federico Di Gregorio
96b2541939 Better fix for py2exe and related tools. 2005-11-15 16:05:15 +00:00
Federico Di Gregorio
fdb68599c7 psycopg1 compatibility module. 2005-04-03 06:13:24 +00:00
Federico Di Gregorio
1141149cd3 License changes. Fixes. Added register_adapter(). 2005-01-20 05:49:40 +00:00
Federico Di Gregorio
c904d97f69 Initial psycopg 2 import after SVN crash. 2004-10-19 03:17:12 +00:00