]>
git.ipfire.org Git - thirdparty/psycopg.git/log
Daniele Varrazzo [Fri, 27 Aug 2021 22:23:27 +0000 (00:23 +0200)]
Merge remote-tracking branch 'origin/better-composite'
Daniele Varrazzo [Thu, 26 Aug 2021 21:39:33 +0000 (23:39 +0200)]
Add binary composite dumper
Daniele Varrazzo [Thu, 26 Aug 2021 18:58:05 +0000 (20:58 +0200)]
Drop TypeInfo.async_fetch(), use fetch() for both connection types
Daniele Varrazzo [Thu, 26 Aug 2021 18:18:57 +0000 (20:18 +0200)]
A more elegant way to customise TypeInfo registration in subclasses
Daniele Varrazzo [Thu, 26 Aug 2021 17:46:53 +0000 (19:46 +0200)]
Make register_composite(), register_range() the public interface
Drop subclassing of `TypeInfo.register()`, leaving it only for the base
task of registering type info and array. This makes them consistent with
other types which don't have a TypeInfo subclass of their own and only
expose a `register_*()` function (e.g. hstore).
Daniele Varrazzo [Thu, 26 Aug 2021 15:24:26 +0000 (17:24 +0200)]
Register composite dumper if the factory is a type
Expose the type as info.python_type after registering.
Daniele Varrazzo [Thu, 26 Aug 2021 12:51:08 +0000 (14:51 +0200)]
Clean up datetime adaptation docs
Daniele Varrazzo [Thu, 26 Aug 2021 02:54:24 +0000 (04:54 +0200)]
Don't use the generic name register_adapters
There will be cases in which there is more than one type in the same
module...
Daniele Varrazzo [Thu, 26 Aug 2021 01:14:32 +0000 (03:14 +0200)]
Verify that arrays of binary types dump correctly
Daniele Varrazzo [Thu, 26 Aug 2021 01:13:56 +0000 (03:13 +0200)]
More types adaptation docs
Daniele Varrazzo [Wed, 25 Aug 2021 23:22:45 +0000 (01:22 +0200)]
Drop TODO doc point to something that people can discover themselves
Let's leave devs some thrill, or this job becomes boring.
Daniele Varrazzo [Wed, 25 Aug 2021 17:57:46 +0000 (19:57 +0200)]
Add binary parameter to cursor.execute()
Daniele Varrazzo [Wed, 25 Aug 2021 11:37:32 +0000 (13:37 +0200)]
Drop Cursor.pgresult duplication in docs
Better style for Connection.pgconn docs. The old version of the cursor
attribute was better.
Daniele Varrazzo [Wed, 25 Aug 2021 02:58:24 +0000 (04:58 +0200)]
Document pgconn, pgresult properties
Daniele Varrazzo [Wed, 25 Aug 2021 02:05:12 +0000 (04:05 +0200)]
Don't use --no-deps to install the pool package
It shouldn't be required at the moment, the package doesn't have any
dependency (although it does depend on psycopg).
Daniele Varrazzo [Wed, 25 Aug 2021 02:02:30 +0000 (04:02 +0200)]
Readmes and metadata cleanup
Daniele Varrazzo [Wed, 25 Aug 2021 01:02:54 +0000 (03:02 +0200)]
Drop TODO point after understanding that Windows has no IANA db
Daniele Varrazzo [Tue, 24 Aug 2021 21:08:29 +0000 (23:08 +0200)]
Drop TODO point regarding Travis
On GitHub Action it's OK.
On flaky platforms these tests are skipped, so let's fail hard if the
proxy fails to come up.
Daniele Varrazzo [Wed, 25 Aug 2021 01:05:24 +0000 (03:05 +0200)]
Merge branch 'array-delim'
Daniele Varrazzo [Tue, 24 Aug 2021 20:55:09 +0000 (22:55 +0200)]
Dump lists keeping the type delimiter into account
Daniele Varrazzo [Tue, 24 Aug 2021 19:14:50 +0000 (21:14 +0200)]
Load arrays of types with delimiters different than comma (e.g. box)
Daniele Varrazzo [Tue, 24 Aug 2021 19:11:20 +0000 (21:11 +0200)]
Add "char" data type loading
Not very used so won't implement it in C, but useful to read catalog
data.
Daniele Varrazzo [Tue, 24 Aug 2021 19:08:43 +0000 (21:08 +0200)]
Fix typeinfo fetch of alt_name
It was returned as the binary value of the oid number.
Daniele Varrazzo [Tue, 24 Aug 2021 19:05:39 +0000 (21:05 +0200)]
Add oid to column representation
Daniele Varrazzo [Tue, 24 Aug 2021 20:59:58 +0000 (22:59 +0200)]
Please mypy and NoReturn function
Daniele Varrazzo [Tue, 24 Aug 2021 17:05:50 +0000 (19:05 +0200)]
Drop Cursor query, params attribute.
Document instead a `_query` object (renamed from the previous `_pgq`) as
helpful but subject to change.
Daniele Varrazzo [Tue, 24 Aug 2021 16:34:38 +0000 (18:34 +0200)]
Add cursor.statusmessage attribute
Daniele Varrazzo [Tue, 24 Aug 2021 15:58:34 +0000 (17:58 +0200)]
Drop Cursor.status property
Daniele Varrazzo [Tue, 24 Aug 2021 15:54:47 +0000 (17:54 +0200)]
Realign async copy tests to the sync ones
Daniele Varrazzo [Tue, 24 Aug 2021 15:20:09 +0000 (17:20 +0200)]
Drop TODO point now working
Add tests to prove it works.
Daniele Varrazzo [Tue, 24 Aug 2021 15:18:30 +0000 (17:18 +0200)]
More helpful error looking up for missing types in the registry
Daniele Varrazzo [Tue, 24 Aug 2021 14:47:45 +0000 (16:47 +0200)]
Drop TODO point on which I'm wrong
Daniele Varrazzo [Tue, 24 Aug 2021 14:46:24 +0000 (16:46 +0200)]
Drop TODO point for something that probably can't be improved
Daniele Varrazzo [Tue, 24 Aug 2021 14:22:16 +0000 (16:22 +0200)]
Add test for as_bytes method of sql objects
Daniele Varrazzo [Tue, 24 Aug 2021 14:21:36 +0000 (16:21 +0200)]
Add links to GitHub tickets related to DSN mangling
Daniele Varrazzo [Sat, 21 Aug 2021 12:39:36 +0000 (14:39 +0200)]
Add _get_connection_params method to connections
Move there the connect_timeout extraction logic, but the method is
intended to do more elaboration on the parameters before connection,
which should include asynchronous DNS lookup and possibly SRV lookup
(RFC 2782) and allows overriding in subclasses to allow experimenting.
Daniele Varrazzo [Tue, 24 Aug 2021 01:59:15 +0000 (03:59 +0200)]
Bump to next dev version
Daniele Varrazzo [Sun, 22 Aug 2021 13:44:32 +0000 (15:44 +0200)]
Use dev dependencies in tox checking
Allow to specify a them in a single place and not having to repeat
package dependencies in the mypy test.
Daniele Varrazzo [Sat, 21 Aug 2021 15:32:32 +0000 (17:32 +0200)]
Link mypy ignore comment to issue reported upstream
Daniele Varrazzo [Sat, 21 Aug 2021 20:56:33 +0000 (22:56 +0200)]
Fix building pool docs
Daniele Varrazzo [Mon, 2 Aug 2021 14:06:16 +0000 (16:06 +0200)]
Drop ConnectionInfo.protocol_version.
Of limited utility. Left exposed in the underlying pgconn obecjt.
Daniele Varrazzo [Sat, 21 Aug 2021 14:22:36 +0000 (16:22 +0200)]
Merge branch 'separate-pool'
Daniele Varrazzo [Sat, 21 Aug 2021 13:42:18 +0000 (15:42 +0200)]
Document that the connection pool is in a separate package
Daniele Varrazzo [Thu, 19 Aug 2021 23:15:20 +0000 (01:15 +0200)]
Build the pool package and include it testing other packages
Daniele Varrazzo [Fri, 13 Aug 2021 13:09:38 +0000 (14:09 +0100)]
Move the pool into a separate package
This would allow different release cycles from the core adapter.
Daniele Varrazzo [Sat, 21 Aug 2021 13:02:19 +0000 (15:02 +0200)]
Update doc building requirements
Drop requirement file from makefile, long gone.
Update furo, as the theme selector was broken.
Daniele Varrazzo [Sat, 21 Aug 2021 01:51:01 +0000 (03:51 +0200)]
Merge branch 'older-libpq'
Daniele Varrazzo [Sat, 21 Aug 2021 01:14:52 +0000 (03:14 +0200)]
Run windows tests in a way more similar to the built packages
Daniele Varrazzo [Fri, 20 Aug 2021 00:46:45 +0000 (02:46 +0200)]
Allow building the C module with older libpq versions
Mostly to work around the obsolete libpq version available for aarch64.
Daniele Varrazzo [Sat, 21 Aug 2021 01:50:40 +0000 (03:50 +0200)]
Merge branch 'split-async'
Daniele Varrazzo [Fri, 13 Aug 2021 09:58:33 +0000 (10:58 +0100)]
async_pool module renamed for consistency with other _async ones
Daniele Varrazzo [Fri, 13 Aug 2021 09:55:59 +0000 (10:55 +0100)]
Move the AsyncCursor implementation in its own module
Daniele Varrazzo [Fri, 13 Aug 2021 09:45:18 +0000 (10:45 +0100)]
Move the AsyncConnection implementation in its own module
Daniele Varrazzo [Mon, 9 Aug 2021 14:39:24 +0000 (15:39 +0100)]
Daniele Varrazzo [Sat, 7 Aug 2021 17:55:20 +0000 (18:55 +0100)]
Add @bloomberg sponsorship
Daniele Varrazzo [Thu, 5 Aug 2021 20:32:10 +0000 (21:32 +0100)]
Merge branch 'generic-row-factories'
Daniele Varrazzo [Thu, 5 Aug 2021 19:40:36 +0000 (20:40 +0100)]
Simplify rows example
Use class_row instead of making your own, drop the recipe that has
become class_row itself.
Daniele Varrazzo [Thu, 5 Aug 2021 19:39:57 +0000 (20:39 +0100)]
Add psycopg.rows.args_row and kwargs_row factories
Daniele Varrazzo [Thu, 5 Aug 2021 16:50:15 +0000 (17:50 +0100)]
Early bailout style in the row factory functions
Daniele Varrazzo [Wed, 4 Aug 2021 13:49:14 +0000 (14:49 +0100)]
Add class_row row factory generator
Daniele Varrazzo [Wed, 4 Aug 2021 01:47:26 +0000 (02:47 +0100)]
Move dict/namedtuple row factory cursor inspection outside row maker
The list of fields names is supposed to be cached at every query result,
not at every row.
Daniele Varrazzo [Wed, 4 Aug 2021 13:28:51 +0000 (14:28 +0100)]
Fix description for cursors returning no column
Denis Laxalde [Thu, 5 Aug 2021 06:45:50 +0000 (08:45 +0200)]
Fix a typo in ConnectionInfo.dsn docstring
Daniele Varrazzo [Mon, 2 Aug 2021 00:47:52 +0000 (02:47 +0200)]
Add pgconn.encrypt_password function
Daniele Varrazzo [Mon, 2 Aug 2021 12:29:42 +0000 (14:29 +0200)]
Include the '()' in the links to the libpq functions
This is more consistent with the rest of the documentation.
Daniele Varrazzo [Mon, 2 Aug 2021 09:59:50 +0000 (11:59 +0200)]
Some docs cleanup
Daniele Varrazzo [Mon, 2 Aug 2021 09:59:20 +0000 (11:59 +0200)]
Add ConnectionInfo.dsn property
Daniele Varrazzo [Mon, 2 Aug 2021 09:34:01 +0000 (11:34 +0200)]
Fix returning connection params in get_parameters() with empty default
"options" and "tty" were returned even if they were set to their
default.
Daniele Varrazzo [Sun, 1 Aug 2021 23:43:25 +0000 (01:43 +0200)]
Test that the row_cursor param can be set explicitly to none
Daniele Varrazzo [Sun, 1 Aug 2021 23:43:01 +0000 (01:43 +0200)]
Make sure to store read_only and deferrable values as bool
Daniele Varrazzo [Sun, 1 Aug 2021 23:17:52 +0000 (01:17 +0200)]
Add test to verify errors in row factories are handled ok
Denis Laxalde [Mon, 2 Aug 2021 09:56:40 +0000 (11:56 +0200)]
Fix a typo in transaction control docs
Daniele Varrazzo [Sun, 1 Aug 2021 23:08:09 +0000 (01:08 +0200)]
Merge branch 'async-row-factory'
Daniele Varrazzo [Sun, 1 Aug 2021 20:33:44 +0000 (22:33 +0200)]
Drop AnyCursor from public interface
Name repurposed internally for the generic to represent the type of
"self" in cursors.
Daniele Varrazzo [Sun, 1 Aug 2021 19:55:56 +0000 (21:55 +0200)]
Improve rows docs
Daniele Varrazzo [Sun, 1 Aug 2021 15:40:01 +0000 (17:40 +0200)]
Drop row_factory from base connection class
Move it to the sync/async concrete classes, specifying the right type.
Daniele Varrazzo [Sun, 1 Aug 2021 12:55:48 +0000 (14:55 +0200)]
Add AsyncRowFactory class
The extra class allow clients to define their RowFactory just taking a
Cursor or an AsyncCursor, which is easier if the program handles only
one type of connection (sync or async).
Using a Generic, the server-side cursors are now subclassed from the
respective client-side cursor (sync and async), which allows to drop a
bit of implementation duplication.
Daniele Varrazzo [Fri, 30 Jul 2021 22:56:49 +0000 (00:56 +0200)]
Add StrDumper to dump strings with text oid
Daniele Varrazzo [Fri, 30 Jul 2021 19:14:58 +0000 (21:14 +0200)]
Don't clear the cursor state after closing
It might be still useful to access the cursor state (e.g. rowcount, the
status message) after the cursor is closed, especially if the block
syntax is used.
Memory use is not really a problem: memory is cleared on GC anyway and
most functions using a cursor don't rely on the memory freed between
close() and the end of the function.
Daniele Varrazzo [Wed, 28 Jul 2021 16:50:57 +0000 (18:50 +0200)]
Increase tolerance in float4 tests
The default tolerance is not quite enough on Postgres < 12 (e.g.
-13.633 != pytest.approx(-13.63298) with the default tolerance of 1e-6)
Daniele Varrazzo [Wed, 28 Jul 2021 15:16:07 +0000 (17:16 +0200)]
Add Float4/Float8 wrappers
Also improved numeric wrapper repr and made them lighter avoiding a dict
creation.
Daniele Varrazzo [Wed, 28 Jul 2021 13:27:19 +0000 (15:27 +0200)]
Skip testing with lists of floats.
There might be rounding problems and problems with inf.
Daniele Varrazzo [Wed, 28 Jul 2021 11:41:10 +0000 (13:41 +0200)]
Fix Bit.io url in backers file
Daniele Varrazzo [Tue, 27 Jul 2021 19:51:36 +0000 (21:51 +0200)]
Docs pool cleanup
Daniele Varrazzo [Mon, 26 Jul 2021 18:56:59 +0000 (20:56 +0200)]
Allow some form of dumping lists of mixed types
Lists of numbers are now dumped as numeric[].
Default to dump text for arrays.
Daniele Varrazzo [Mon, 26 Jul 2021 14:35:03 +0000 (16:35 +0200)]
Add Error.sqlstate as a static attribute
Allow to lookup the mapping const name -> sqlstate too, and lookup is
case insensitive.
Daniele Varrazzo [Mon, 26 Jul 2021 00:53:18 +0000 (02:53 +0200)]
Fix quote of Binary wrapper
Daniele Varrazzo [Mon, 26 Jul 2021 00:19:46 +0000 (02:19 +0200)]
Emit quoted values valid for every standard_conforming_string value
Work around the unpredictable return value from the libpq.
Daniele Varrazzo [Sun, 25 Jul 2021 19:26:12 +0000 (21:26 +0200)]
Fix bytes quoting with non standard conforming strings
Daniele Varrazzo [Sun, 25 Jul 2021 19:24:02 +0000 (21:24 +0200)]
Make sure the conn.autocommit attribute is set to a bool
Daniele Varrazzo [Sun, 25 Jul 2021 19:23:52 +0000 (21:23 +0200)]
Fix docs typo
Daniele Varrazzo [Sun, 25 Jul 2021 00:22:55 +0000 (02:22 +0200)]
Fix idempotence of server side cursors close()
Daniele Varrazzo [Sat, 24 Jul 2021 20:29:43 +0000 (22:29 +0200)]
More readable field name in Column repr
Daniele Varrazzo [Fri, 23 Jul 2021 21:32:37 +0000 (23:32 +0200)]
Clear the caplog in retried tests
Daniele Varrazzo [Fri, 23 Jul 2021 20:59:44 +0000 (22:59 +0200)]
Don't register any TypeInfo on oid 0
Someone may conceivably register info of an array only. Let's not
clobber INVALID_OID, I wouldn't know the side effects...
Daniele Varrazzo [Fri, 23 Jul 2021 16:45:11 +0000 (18:45 +0200)]
Don't copy the types map from context to recursive dumpers
It can be accessed from the object's transformer.
Daniele Varrazzo [Fri, 23 Jul 2021 15:47:10 +0000 (17:47 +0200)]
Use uppercase SQL throughout code and docs
I personally prefer lowercase, but uppercase is more familiar. There is
also a tiny advantage in greppability, in case someone tries to trace a
generated statement in the code.
The myth that using UPPERCASE the database will sense your urgency and
will run your queries faster has been dispelled.
Daniele Varrazzo [Fri, 23 Jul 2021 15:11:14 +0000 (17:11 +0200)]
Cache generated begin statement on the connection
Daniele Varrazzo [Fri, 16 Jul 2021 01:40:48 +0000 (03:40 +0200)]
Add hstore adapters
Daniele Varrazzo [Thu, 15 Jul 2021 11:34:22 +0000 (13:34 +0200)]
Respects transaction status of the connection used by TypeInfo.fetch
Also make sure that the method returns None instead of throwing an
exception and leaving the connection broken in case the object is not
found.