]>
git.ipfire.org Git - thirdparty/psycopg.git/log
Daniele Varrazzo [Thu, 2 Apr 2020 04:44:44 +0000 (17:44 +1300)]
Modules import to register builtin types moved to types package
Daniele Varrazzo [Thu, 2 Apr 2020 02:29:52 +0000 (15:29 +1300)]
exceptions module renamed to errors
To be part of the public interface, for compatibility with psycopg2
Daniele Varrazzo [Thu, 2 Apr 2020 01:58:46 +0000 (14:58 +1300)]
Module adaptation renamed to adapt
I figure out this is part of the external interface. Let's give it a
nice name.
Daniele Varrazzo [Thu, 2 Apr 2020 01:35:55 +0000 (14:35 +1300)]
Added text types conversion for numeric types and bools
Plenty of tests, too.
Daniele Varrazzo [Wed, 1 Apr 2020 13:25:58 +0000 (02:25 +1300)]
Added tests about adapters/casters selection, some fixes
- Added Transformer.cast() function;
- Can return binary results even with no input parameters;
- libpq functions accept sequences rather than lists.
Daniele Varrazzo [Wed, 1 Apr 2020 11:59:01 +0000 (00:59 +1300)]
Include None in AdaptContext
Using Union[None...] instead of Optional[... is a choice. None has a
meaning, it means global, not optional.
Daniele Varrazzo [Tue, 31 Mar 2020 16:43:04 +0000 (05:43 +1300)]
Definition with a wrong default changed into declaration
Daniele Varrazzo [Tue, 31 Mar 2020 08:28:09 +0000 (21:28 +1300)]
Added mypy tests on travis
Daniele Varrazzo [Tue, 31 Mar 2020 06:07:39 +0000 (19:07 +1300)]
Added install instruction to readme
Daniele Varrazzo [Tue, 31 Mar 2020 05:56:11 +0000 (18:56 +1300)]
Use == instead of is to check the Wait states
Now they are integers so is, while it works, is an implementation
detail.
Daniele Varrazzo [Tue, 31 Mar 2020 05:45:08 +0000 (18:45 +1300)]
Use the selectors module instead of select
Choose a better way to wait for readyness than select if available.
Also fixed an error in both sync and async waiting: don't discard the
result of send().
Daniele Varrazzo [Tue, 31 Mar 2020 02:16:02 +0000 (15:16 +1300)]
setup.py fixed
Sub-packages weren't installed. Now it should be possible to install it
using:
pip install "git+https://github.com/psycopg/psycopg3.git#egg=psycopg3"
Note that it was already possible to do so using
pip install -e "git+https://github.com/psycopg/psycopg3.git#egg=psycopg3"
Daniele Varrazzo [Tue, 31 Mar 2020 02:15:35 +0000 (15:15 +1300)]
Added license
Daniele Varrazzo [Mon, 30 Mar 2020 15:21:36 +0000 (04:21 +1300)]
Added types stub for ctypes functions
Daniele Varrazzo [Sun, 29 Mar 2020 16:11:27 +0000 (05:11 +1300)]
Another couple of functions marked as returning Oid
Daniele Varrazzo [Sun, 29 Mar 2020 15:45:45 +0000 (04:45 +1300)]
Solved problem with namedtuple index
There's already a method index on the nametuple :D
Daniele Varrazzo [Sun, 29 Mar 2020 15:36:14 +0000 (04:36 +1300)]
Added Oid type
Daniele Varrazzo [Sun, 29 Mar 2020 15:18:19 +0000 (04:18 +1300)]
Fixed problem with adapters decorators
Now mypy --strict passes 100%
Daniele Varrazzo [Sun, 29 Mar 2020 14:39:21 +0000 (03:39 +1300)]
Added most type annotations
mypy almost passes in --strict mode
Daniele Varrazzo [Sun, 29 Mar 2020 05:24:10 +0000 (18:24 +1300)]
Also run mypy on tests and setup
Added mypy config to tox.ini
Daniele Varrazzo [Sun, 29 Mar 2020 05:03:07 +0000 (18:03 +1300)]
First pass of mypy annotation
Just fix what doesn't make mypy happy
Daniele Varrazzo [Sun, 29 Mar 2020 02:18:38 +0000 (15:18 +1300)]
Dropped local encoder/decoder in int adapters
Premature optimization, and leaks in the globals adapters maps, which
are otherwise very readable in modern Python versions.
Daniele Varrazzo [Sun, 29 Mar 2020 01:47:11 +0000 (14:47 +1300)]
Oid map updated to PG 12
Daniele Varrazzo [Sun, 29 Mar 2020 01:40:10 +0000 (14:40 +1300)]
INVALID_OID moved to oids module
Daniele Varrazzo [Sun, 29 Mar 2020 01:39:04 +0000 (14:39 +1300)]
Fixed oids order
Daniele Varrazzo [Sat, 28 Mar 2020 15:31:31 +0000 (04:31 +1300)]
Added regtype spelling of data types to oid table
Daniele Varrazzo [Sat, 28 Mar 2020 15:02:51 +0000 (04:02 +1300)]
Adapter/caster register functions can be used as decorators
Daniele Varrazzo [Sat, 28 Mar 2020 14:54:21 +0000 (03:54 +1300)]
register function and global adapters map moved as class members
Daniele Varrazzo [Sat, 28 Mar 2020 14:45:09 +0000 (03:45 +1300)]
Adapters moved to the types package
Daniele Varrazzo [Sat, 28 Mar 2020 14:31:13 +0000 (03:31 +1300)]
Added map of types oids
Daniele Varrazzo [Sat, 28 Mar 2020 12:06:09 +0000 (01:06 +1300)]
Added adapter/caster decorators
Daniele Varrazzo [Sat, 28 Mar 2020 11:50:19 +0000 (00:50 +1300)]
Added register_adapter/caster functions
Daniele Varrazzo [Sat, 28 Mar 2020 11:22:20 +0000 (00:22 +1300)]
Making adapters/casters simpler
It can be either a function or an Adapter/Typecaster instance, in case
configuration based on class/oid/connection is required.
Adapter functions can optionally return an oid.
Daniele Varrazzo [Sat, 28 Mar 2020 09:52:41 +0000 (22:52 +1300)]
Separate Transformer into Adapter and Typecaster
There isn't much sense to have a single, more complex object, doing two
potentially unrelated things.
Daniele Varrazzo [Fri, 27 Mar 2020 13:02:10 +0000 (02:02 +1300)]
Added binary results from cursor
Daniele Varrazzo [Fri, 27 Mar 2020 12:26:57 +0000 (01:26 +1300)]
Added basic typecasting and cursor.fetchone()
Daniele Varrazzo [Fri, 27 Mar 2020 09:02:42 +0000 (22:02 +1300)]
Added sketch of adaptation layer
Daniele Varrazzo [Fri, 27 Mar 2020 08:13:46 +0000 (21:13 +1300)]
Added format enum
Daniele Varrazzo [Fri, 27 Mar 2020 07:22:42 +0000 (20:22 +1300)]
query2pg returns formats too
Daniele Varrazzo [Fri, 27 Mar 2020 06:55:43 +0000 (19:55 +1300)]
Allow b and s formats on query split
Daniele Varrazzo [Fri, 27 Mar 2020 06:38:35 +0000 (19:38 +1300)]
Verbose regexp to parse placeholders
Daniele Varrazzo [Thu, 26 Mar 2020 13:19:41 +0000 (02:19 +1300)]
Typoeoes
Daniele Varrazzo [Tue, 24 Mar 2020 11:34:11 +0000 (00:34 +1300)]
Skip certain tests on PG < 10
The server raises "could not determine data type" for pretty simple
queries of the form "select $1, $2, $3"
Should ask the PG devs if there is a workaround short of knowing the
oids.
Daniele Varrazzo [Tue, 24 Mar 2020 11:22:44 +0000 (00:22 +1300)]
Display libpq version on test header
Trying to work out which version is failing.
Daniele Varrazzo [Tue, 24 Mar 2020 10:48:36 +0000 (23:48 +1300)]
tmp
Daniele Varrazzo [Tue, 24 Mar 2020 10:29:55 +0000 (23:29 +1300)]
Skip test for waiting on send
It doesn't seem reliable
Daniele Varrazzo [Tue, 24 Mar 2020 10:19:22 +0000 (23:19 +1300)]
Added class_for_state() stub
Daniele Varrazzo [Tue, 24 Mar 2020 10:14:34 +0000 (23:14 +1300)]
Skip hostaddr test for PG version < 12
Daniele Varrazzo [Tue, 24 Mar 2020 07:51:52 +0000 (20:51 +1300)]
Use 'async with lock' instead of deprecated 'with await lock'
Daniele Varrazzo [Tue, 24 Mar 2020 07:44:08 +0000 (20:44 +1300)]
Added PQlibVersion() wrapper
Skip importing PQhostaddr from libpq version where it's not available.
Daniele Varrazzo [Tue, 24 Mar 2020 07:18:41 +0000 (20:18 +1300)]
Flake8 config tweaked for black compatibility
Daniele Varrazzo [Tue, 24 Mar 2020 07:09:47 +0000 (20:09 +1300)]
Added travis config
Daniele Varrazzo [Tue, 24 Mar 2020 06:59:29 +0000 (19:59 +1300)]
Added async execute
Daniele Varrazzo [Sat, 21 Mar 2020 21:27:05 +0000 (10:27 +1300)]
Added query mangling and basic cursor execute
Daniele Varrazzo [Sat, 21 Mar 2020 21:26:09 +0000 (10:26 +1300)]
Break endless loop of response on COPY
Daniele Varrazzo [Sat, 21 Mar 2020 12:46:20 +0000 (01:46 +1300)]
Fixed async connection lock to be awaitable
Daniele Varrazzo [Sat, 21 Mar 2020 10:43:27 +0000 (23:43 +1300)]
Waiting implementation exposed as connection method
Daniele Varrazzo [Sat, 21 Mar 2020 10:31:23 +0000 (23:31 +1300)]
Added PQsendQueryParams wrapper
Daniele Varrazzo [Sat, 21 Mar 2020 09:40:34 +0000 (22:40 +1300)]
Enum values simplified
In C the scope is global so the enum values need a healty dose of
prefixing. In Python you can't import the value without separating from
the class so even if there is more than one called ``OK`` it's... ok.
Daniele Varrazzo [Sat, 21 Mar 2020 09:34:11 +0000 (22:34 +1300)]
Use an event instead of a queue in wait_async
Daniele Varrazzo [Fri, 20 Mar 2020 13:40:19 +0000 (02:40 +1300)]
Added commit/rollback connection methods
Daniele Varrazzo [Fri, 20 Mar 2020 13:30:27 +0000 (02:30 +1300)]
Added PQresult info functions
Daniele Varrazzo [Fri, 20 Mar 2020 11:40:25 +0000 (00:40 +1300)]
Added DBAPI constants
Daniele Varrazzo [Fri, 20 Mar 2020 11:30:08 +0000 (00:30 +1300)]
Added sketch of high-level connection objects
Trying to create two similar Connection/AsyncConnection classes, a DBAPI
compliant and an async DBAPI-inspired.
The classes share the same implementation of asynchronous connection,
which is independent from the waiting method, and offer different ways
to wait: one blocking the thread, the other as async coroutine.
Daniele Varrazzo [Fri, 20 Mar 2020 11:12:31 +0000 (00:12 +1300)]
dsn fixture returns str instead of bytes
Daniele Varrazzo [Thu, 19 Mar 2020 13:30:19 +0000 (02:30 +1300)]
black cleanup
Daniele Varrazzo [Thu, 19 Mar 2020 09:03:14 +0000 (22:03 +1300)]
Added PGconn.make_empty_result()
Daniele Varrazzo [Thu, 19 Mar 2020 08:40:15 +0000 (21:40 +1300)]
Added high-level functions to manipulate conninfo
Daniele Varrazzo [Thu, 19 Mar 2020 07:57:10 +0000 (20:57 +1300)]
Typo adaapter fixed
Daniele Varrazzo [Thu, 19 Mar 2020 07:55:10 +0000 (20:55 +1300)]
Added error_message function instead of message_str method
Keeping the pq interface simple and low level and moving the policy a
bit aside.
Daniele Varrazzo [Wed, 18 Mar 2020 11:26:11 +0000 (00:26 +1300)]
Fixed checking for NULL results in ctypes layer
Also check null result from connection functions.
Daniele Varrazzo [Wed, 18 Mar 2020 11:25:50 +0000 (00:25 +1300)]
Added exceptions module
Daniele Varrazzo [Tue, 17 Mar 2020 10:46:08 +0000 (23:46 +1300)]
Raise a few errors in pg implementation module
Better to make this interface a bit thicker instead of forcing user to
write Python as it was C.
Daniele Varrazzo [Mon, 16 Mar 2020 08:12:38 +0000 (21:12 +1300)]
Added async basic functions and test for it
Daniele Varrazzo [Mon, 16 Mar 2020 06:54:40 +0000 (19:54 +1300)]
Added PQdescribePortal wrapper
Daniele Varrazzo [Mon, 16 Mar 2020 06:48:05 +0000 (19:48 +1300)]
Added prepared statements and description
Daniele Varrazzo [Mon, 16 Mar 2020 06:06:35 +0000 (19:06 +1300)]
Don't report the value on type error, only the type
The value may contain sensitive info.
Daniele Varrazzo [Sun, 15 Mar 2020 21:05:20 +0000 (10:05 +1300)]
Added tox to create a test grid
Daniele Varrazzo [Sun, 15 Mar 2020 13:24:11 +0000 (02:24 +1300)]
Added tests for PGresult
Daniele Varrazzo [Sun, 15 Mar 2020 11:58:25 +0000 (00:58 +1300)]
pq tests moved into a dir of its own
Daniele Varrazzo [Sun, 15 Mar 2020 11:56:35 +0000 (00:56 +1300)]
Added PQexecParams wrapper
Can send and return binary data too.
Daniele Varrazzo [Sun, 15 Mar 2020 09:40:36 +0000 (22:40 +1300)]
Encoding/decoding in pq interface dropped
Only deal with bytes here. Unicode is a policy that will be dealt with
by the clients.
Daniele Varrazzo [Sun, 15 Mar 2020 04:14:49 +0000 (17:14 +1300)]
pq made into a package
Daniele Varrazzo [Sun, 15 Mar 2020 04:09:27 +0000 (17:09 +1300)]
Added encoding mapping table between Postgres and Python
Daniele Varrazzo [Sun, 15 Mar 2020 03:04:36 +0000 (16:04 +1300)]
Wrapping PQexec and PGresult
Daniele Varrazzo [Sun, 15 Mar 2020 02:36:49 +0000 (15:36 +1300)]
Added funding file
Daniele Varrazzo [Sat, 14 Mar 2020 22:07:14 +0000 (11:07 +1300)]
Added funding file
Daniele Varrazzo [Sat, 14 Mar 2020 12:54:03 +0000 (01:54 +1300)]
Parsing conninfo and returning defaults moved to its own class
Daniele Varrazzo [Sat, 14 Mar 2020 12:38:49 +0000 (01:38 +1300)]
Added needs_password, used_password, ssl_in_use on PGconn
Daniele Varrazzo [Sat, 14 Mar 2020 12:07:02 +0000 (01:07 +1300)]
Added PGconn.backend_pid
Daniele Varrazzo [Sat, 14 Mar 2020 12:02:32 +0000 (01:02 +1300)]
Added PQconn.server_version
Daniele Varrazzo [Sat, 14 Mar 2020 11:59:36 +0000 (00:59 +1300)]
Added PGconn.protocol_version
Daniele Varrazzo [Sat, 14 Mar 2020 11:56:31 +0000 (00:56 +1300)]
Added PGconn.parameter_status
Daniele Varrazzo [Sat, 14 Mar 2020 11:28:10 +0000 (00:28 +1300)]
Dropped pfefix from a couple of enums
Daniele Varrazzo [Sat, 14 Mar 2020 11:25:08 +0000 (00:25 +1300)]
Added PGconn.transaction_status
Daniele Varrazzo [Sat, 14 Mar 2020 11:13:29 +0000 (00:13 +1300)]
Added a bunch of informative connection properties
Daniele Varrazzo [Sat, 14 Mar 2020 10:29:43 +0000 (23:29 +1300)]
Added parse_conninfo()
Daniele Varrazzo [Sat, 14 Mar 2020 05:39:11 +0000 (18:39 +1300)]
Added PQping
Daniele Varrazzo [Sat, 14 Mar 2020 05:30:03 +0000 (18:30 +1300)]
Added PQconn.reset sync and async
Daniele Varrazzo [Sat, 14 Mar 2020 05:17:09 +0000 (18:17 +1300)]
PGconn.connectdb renamed to connect