]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
4 years agoTest that the row_cursor param can be set explicitly to none
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

4 years agoMake sure to store read_only and deferrable values as bool
Daniele Varrazzo [Sun, 1 Aug 2021 23:43:01 +0000 (01:43 +0200)] 
Make sure to store read_only and deferrable values as bool

4 years agoAdd test to verify errors in row factories are handled ok
Daniele Varrazzo [Sun, 1 Aug 2021 23:17:52 +0000 (01:17 +0200)] 
Add test to verify errors in row factories are handled ok

4 years agoFix a typo in transaction control docs
Denis Laxalde [Mon, 2 Aug 2021 09:56:40 +0000 (11:56 +0200)] 
Fix a typo in transaction control docs

4 years agoMerge branch 'async-row-factory'
Daniele Varrazzo [Sun, 1 Aug 2021 23:08:09 +0000 (01:08 +0200)] 
Merge branch 'async-row-factory'

4 years agoDrop AnyCursor from public interface
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.

4 years agoImprove rows docs
Daniele Varrazzo [Sun, 1 Aug 2021 19:55:56 +0000 (21:55 +0200)] 
Improve rows docs

4 years agoDrop row_factory from base connection class
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.

4 years agoAdd AsyncRowFactory class
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.

4 years agoAdd StrDumper to dump strings with text oid
Daniele Varrazzo [Fri, 30 Jul 2021 22:56:49 +0000 (00:56 +0200)] 
Add StrDumper to dump strings with text oid

4 years agoDon't clear the cursor state after closing
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.

4 years agoIncrease tolerance in float4 tests
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)

4 years agoAdd Float4/Float8 wrappers
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.

4 years agoSkip testing with lists of floats.
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.

4 years agoFix Bit.io url in backers file
Daniele Varrazzo [Wed, 28 Jul 2021 11:41:10 +0000 (13:41 +0200)] 
Fix Bit.io url in backers file

4 years agoDocs pool cleanup
Daniele Varrazzo [Tue, 27 Jul 2021 19:51:36 +0000 (21:51 +0200)] 
Docs pool cleanup

4 years agoAllow some form of dumping lists of mixed types
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.

4 years agoAdd Error.sqlstate as a static attribute
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.

4 years agoFix quote of Binary wrapper
Daniele Varrazzo [Mon, 26 Jul 2021 00:53:18 +0000 (02:53 +0200)] 
Fix quote of Binary wrapper

4 years agoEmit quoted values valid for every standard_conforming_string value
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.

4 years agoFix bytes quoting with non standard conforming strings
Daniele Varrazzo [Sun, 25 Jul 2021 19:26:12 +0000 (21:26 +0200)] 
Fix bytes quoting with non standard conforming strings

4 years agoMake sure the conn.autocommit attribute is set to a bool
Daniele Varrazzo [Sun, 25 Jul 2021 19:24:02 +0000 (21:24 +0200)] 
Make sure the conn.autocommit attribute is set to a bool

4 years agoFix docs typo
Daniele Varrazzo [Sun, 25 Jul 2021 19:23:52 +0000 (21:23 +0200)] 
Fix docs typo

4 years agoFix idempotence of server side cursors close()
Daniele Varrazzo [Sun, 25 Jul 2021 00:22:55 +0000 (02:22 +0200)] 
Fix idempotence of server side cursors close()

4 years agoMore readable field name in Column repr
Daniele Varrazzo [Sat, 24 Jul 2021 20:29:43 +0000 (22:29 +0200)] 
More readable field name in Column repr

4 years agoClear the caplog in retried tests
Daniele Varrazzo [Fri, 23 Jul 2021 21:32:37 +0000 (23:32 +0200)] 
Clear the caplog in retried tests

4 years agoDon't register any TypeInfo on oid 0
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...

4 years agoDon't copy the types map from context to recursive dumpers
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.

4 years agoUse uppercase SQL throughout code and docs
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.

4 years agoCache generated begin statement on the connection
Daniele Varrazzo [Fri, 23 Jul 2021 15:11:14 +0000 (17:11 +0200)] 
Cache generated begin statement on the connection

4 years agoAdd hstore adapters
Daniele Varrazzo [Fri, 16 Jul 2021 01:40:48 +0000 (03:40 +0200)] 
Add hstore adapters

4 years agoRespects transaction status of the connection used by TypeInfo.fetch
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.

4 years agoMerge branch 'transaction-control'
Daniele Varrazzo [Fri, 23 Jul 2021 14:57:32 +0000 (16:57 +0200)] 
Merge branch 'transaction-control'

4 years agoImplement the transaction control attributes
Daniele Varrazzo [Fri, 23 Jul 2021 14:28:58 +0000 (16:28 +0200)] 
Implement the transaction control attributes

4 years agoAdd IsolationLevel and transaction control attributes on connection
Daniele Varrazzo [Fri, 23 Jul 2021 13:01:34 +0000 (15:01 +0200)] 
Add IsolationLevel and transaction control attributes on connection

Only add the documentation and the property: they don't work yet.

4 years agoHandle timestamps which would overflow in UTC but not in the want timezone
Daniele Varrazzo [Thu, 22 Jul 2021 21:17:53 +0000 (23:17 +0200)] 
Handle timestamps which would overflow in UTC but not in the want timezone

4 years agoBetter display of block examples in docs
Daniele Varrazzo [Thu, 22 Jul 2021 15:53:10 +0000 (17:53 +0200)] 
Better display of block examples in docs

4 years agoFix server-side cursor close() with committed transactions.
Daniele Varrazzo [Thu, 22 Jul 2021 15:43:39 +0000 (17:43 +0200)] 
Fix server-side cursor close() with committed transactions.

4 years agoMove withhold/scrollable as server-side cursor attributes
Daniele Varrazzo [Thu, 22 Jul 2021 15:41:50 +0000 (17:41 +0200)] 
Move withhold/scrollable as server-side cursor attributes

Add respective properties to read back the state.

4 years agohold renamed to withhold for server side cursors
Daniele Varrazzo [Thu, 22 Jul 2021 12:53:40 +0000 (14:53 +0200)] 
hold renamed to withhold for server side cursors

4 years agoAdd cursor_factory and server_cursor_factory attributes
Daniele Varrazzo [Sat, 17 Jul 2021 00:14:47 +0000 (02:14 +0200)] 
Add cursor_factory and server_cursor_factory attributes

4 years agoRemove format param from cursor constructor
Daniele Varrazzo [Fri, 16 Jul 2021 15:03:53 +0000 (17:03 +0200)] 
Remove format param from cursor constructor

4 years agoFix Range get_key/upgrade
Daniele Varrazzo [Mon, 19 Jul 2021 18:10:48 +0000 (20:10 +0200)] 
Fix Range get_key/upgrade

The adapter doesn't need upgrading not when it knows its oid but when it
adapts a Range strict subclass. The difference emerges if a query
handles different types of ranges in composite types.

Problem found by random testing: https://github.com/psycopg/psycopg/runs/3104464032
Thank you, faker!

4 years agoDisplay the Dumper oid in its repr
Daniele Varrazzo [Mon, 19 Jul 2021 18:16:55 +0000 (20:16 +0200)] 
Display the Dumper oid in its repr

4 years agoAdd faker context manager to help found problematic values
Daniele Varrazzo [Mon, 19 Jul 2021 16:44:41 +0000 (18:44 +0200)] 
Add faker context manager to help found problematic values

4 years agoRetry flaky tests
Daniele Varrazzo [Mon, 19 Jul 2021 03:43:09 +0000 (05:43 +0200)] 
Retry flaky tests

4 years agoMake starting the test proxy idempotent
Daniele Varrazzo [Mon, 19 Jul 2021 03:12:52 +0000 (05:12 +0200)] 
Make starting the test proxy idempotent

Helps with retrying tests.

4 years agoFix Windows package build
Daniele Varrazzo [Sun, 18 Jul 2021 23:32:24 +0000 (01:32 +0200)] 
Fix Windows package build

The package was built with a libpq 11, found along the path in the PHP
dir. And with the libiconv found in the Git directory. All very
worrying.

So, add to the PATH the Postgres bin directory and deal with the
delvewheel exception of libiconv (mentioned in
https://github.com/adang1345/delvewheel/issues/13).

Also fix confusion about where does this stuff run and where is the
server. There is no Docker image here, so we can start the server from
the workflow steps and access it from cibiuldwheel on localhost.

4 years agoDrop outdated script to build wheel packages
Daniele Varrazzo [Sun, 18 Jul 2021 14:22:47 +0000 (16:22 +0200)] 
Drop outdated script to build wheel packages

Using cibuildwheel and the scripts in the `tools/build` directory now.

4 years agoAdd notes about making a release
Daniele Varrazzo [Sun, 18 Jul 2021 02:38:35 +0000 (04:38 +0200)] 
Add notes about making a release

4 years agoBump to next dev release
Daniele Varrazzo [Sun, 18 Jul 2021 02:39:46 +0000 (04:39 +0200)] 
Bump to next dev release

4 years agoBump to next version to build test packages 3.0.dev1
Daniele Varrazzo [Sun, 18 Jul 2021 01:37:57 +0000 (03:37 +0200)] 
Bump to next version to build test packages

4 years agoTest C extension on Windows and build binary packages
Daniele Varrazzo [Sat, 17 Jul 2021 00:39:40 +0000 (02:39 +0200)] 
Test C extension on Windows and build binary packages

The built wheel package seems broken, but delocating it seems to fix it.

Use the PG_CONFIG env var to specify the pg_config location because
hacking the path is not straightforward with cibuildwheel and has
unwanted side effects with delvewheel.

4 years agoDrop test skip for a long solved problem
Daniele Varrazzo [Sun, 18 Jul 2021 01:34:23 +0000 (03:34 +0200)] 
Drop test skip for a long solved problem

4 years agoRetry some flaky tests
Daniele Varrazzo [Sat, 17 Jul 2021 01:52:51 +0000 (03:52 +0200)] 
Retry some flaky tests

4 years agoFix test retry pattern
Daniele Varrazzo [Fri, 16 Jul 2021 23:35:54 +0000 (01:35 +0200)] 
Fix test retry pattern

4 years agoFix types registry shallow copy
Daniele Varrazzo [Fri, 16 Jul 2021 01:41:06 +0000 (03:41 +0200)] 
Fix types registry shallow copy

Mark the template as dirty, so that if it's changed the registries that
were cloned for it will remain unchanged.

4 years agoAdd fixture to restore the state of the global adapters
Daniele Varrazzo [Fri, 16 Jul 2021 01:15:45 +0000 (03:15 +0200)] 
Add fixture to restore the state of the global adapters

4 years agoFix dumping arrays of different versions of network objects
Daniele Varrazzo [Wed, 14 Jul 2021 15:48:21 +0000 (17:48 +0200)] 
Fix dumping arrays of different versions of network objects

Use a single dumper for both IPv4 and IPv6 so that the array sub_dumper
is not ambiguous.

4 years agoAt import -> at import time
Daniele Varrazzo [Wed, 14 Jul 2021 00:51:36 +0000 (02:51 +0200)] 
At import -> at import time

4 years agoMove "from psycopg2" docs page under basic
Daniele Varrazzo [Wed, 14 Jul 2021 00:46:50 +0000 (02:46 +0200)] 
Move "from psycopg2" docs page under basic

And tweak it a bit.

4 years agoDrop a fixme related to a bug closed in furo docs style
Daniele Varrazzo [Wed, 14 Jul 2021 00:21:43 +0000 (02:21 +0200)] 
Drop a fixme related to a bug closed in furo docs style

I prefer our style though, so we are not reverting back to the template style.

4 years agoAdd link to GitHub Actions runner bug hack
Daniele Varrazzo [Wed, 14 Jul 2021 00:19:48 +0000 (02:19 +0200)] 
Add link to GitHub Actions runner bug hack

4 years agoFix reference target to the psycopg module
Daniele Varrazzo [Wed, 14 Jul 2021 00:09:51 +0000 (02:09 +0200)] 
Fix reference target to the psycopg module

It was stolen by the errors module.

4 years agoLeft align table contents in the docs
Daniele Varrazzo [Wed, 14 Jul 2021 00:09:32 +0000 (02:09 +0200)] 
Left align table contents in the docs

4 years agoConsistent TOC expansion in docs second level pages
Daniele Varrazzo [Tue, 13 Jul 2021 23:46:28 +0000 (01:46 +0200)] 
Consistent TOC expansion in docs second level pages

4 years agoAdapt docs cleanup
Daniele Varrazzo [Tue, 13 Jul 2021 23:43:29 +0000 (01:43 +0200)] 
Adapt docs cleanup

4 years agoCorrections to the types module docs
Daniele Varrazzo [Tue, 13 Jul 2021 01:55:05 +0000 (03:55 +0200)] 
Corrections to the types module docs

4 years agoAdd example of numeric-to-float loading
Daniele Varrazzo [Tue, 13 Jul 2021 01:45:10 +0000 (03:45 +0200)] 
Add example of numeric-to-float loading

4 years agoAdd wheel package to dev dependencies
Daniele Varrazzo [Tue, 13 Jul 2021 01:07:58 +0000 (03:07 +0200)] 
Add wheel package to dev dependencies

We get warnings when we build the C extension without it. Probably they
are harmless, but let's pretend we understand what it is for.

4 years agoAdd sphinx-autobuild to docs dependencies
Daniele Varrazzo [Tue, 13 Jul 2021 01:04:54 +0000 (03:04 +0200)] 
Add sphinx-autobuild to docs dependencies

It would probably be a dev dependency, but it would pull the whole
Sphinx in devs, which is not necessarily needed there.

4 years agoDisplay two title levels in the main docs TOC
Daniele Varrazzo [Tue, 13 Jul 2021 01:00:57 +0000 (03:00 +0200)] 
Display two title levels in the main docs TOC

4 years agoDrop repetition in adapt docs, and more cleanup around it
Daniele Varrazzo [Tue, 13 Jul 2021 01:00:36 +0000 (03:00 +0200)] 
Drop repetition in adapt docs, and more cleanup around it

4 years agoFix tox docs build
Daniele Varrazzo [Tue, 13 Jul 2021 00:27:48 +0000 (02:27 +0200)] 
Fix tox docs build

4 years agoDocs building dependencies updated
Daniele Varrazzo [Mon, 12 Jul 2021 23:50:32 +0000 (01:50 +0200)] 
Docs building dependencies updated

With the current documentation the image in advanced/adapt is not
displayed. Trying if upgrading fixes the issue because the furo theme
was upgraded but Sphinx didn't and they may be incompatible now.

Docs build dependencies moved to setup.py.

4 years agoAdding more glue content to docs
Daniele Varrazzo [Mon, 12 Jul 2021 17:32:14 +0000 (19:32 +0200)] 
Adding more glue content to docs

4 years agoMove copy docs to the basic section
Daniele Varrazzo [Mon, 12 Jul 2021 17:26:29 +0000 (19:26 +0200)] 
Move copy docs to the basic section

4 years agoAdd docs for the psycopg module
Daniele Varrazzo [Mon, 12 Jul 2021 17:05:28 +0000 (19:05 +0200)] 
Add docs for the psycopg module

4 years agoRetry more flaky tests
Daniele Varrazzo [Mon, 12 Jul 2021 16:37:17 +0000 (18:37 +0200)] 
Retry more flaky tests

4 years agoMerge branch 'adapters-protocols'
Daniele Varrazzo [Mon, 12 Jul 2021 22:31:32 +0000 (00:31 +0200)] 
Merge branch 'adapters-protocols'

4 years agoproto modules renamed to abc
Daniele Varrazzo [Mon, 12 Jul 2021 15:54:57 +0000 (17:54 +0200)] 
proto modules renamed to abc

4 years agoImprovements to the adaptation documentation
Daniele Varrazzo [Mon, 12 Jul 2021 15:36:19 +0000 (17:36 +0200)] 
Improvements to the adaptation documentation

4 years agoAdd unit tests for register_loader/dumper types
Daniele Varrazzo [Sun, 11 Jul 2021 13:02:44 +0000 (15:02 +0200)] 
Add unit tests for register_loader/dumper types

Use the more idiomatic type name for the other tests.

4 years agoExpose postgres.adapters from the psycopg package
Daniele Varrazzo [Sun, 11 Jul 2021 12:41:54 +0000 (14:41 +0200)] 
Expose postgres.adapters from the psycopg package

4 years agoDrop flake8 ignore on types/__init__ file
Daniele Varrazzo [Sun, 11 Jul 2021 12:24:30 +0000 (14:24 +0200)] 
Drop flake8 ignore on types/__init__ file

4 years agoDrop .register() method from Dumper/Loader classes
Daniele Varrazzo [Sun, 11 Jul 2021 02:16:25 +0000 (04:16 +0200)] 
Drop .register() method from Dumper/Loader classes

Use the register_dumper/loader() method on the adapters, readily
available from the context. A bit of a violation of Demeter law, but
much more intuitive and simplifies the Dumper/Loader interface (the
methods were outside the protocol).

4 years agoAdd postgres module
Daniele Varrazzo [Sun, 11 Jul 2021 02:14:17 +0000 (04:14 +0200)] 
Add postgres module

The module exports PostgreSQL specific configurations: the mapping
oid -> types and the mapping from oid/types to dumpers/loaders.

4 years agoAllow adapter protocols tests to run on Python 3.6
Daniele Varrazzo [Sun, 11 Jul 2021 02:27:20 +0000 (04:27 +0200)] 
Allow adapter protocols tests to run on Python 3.6

4 years agoAdd Loader protocol
Daniele Varrazzo [Sat, 10 Jul 2021 16:46:07 +0000 (18:46 +0200)] 
Add Loader protocol

4 years agoRemove the cls attribute from the Dumper protocol
Daniele Varrazzo [Sat, 10 Jul 2021 16:41:44 +0000 (18:41 +0200)] 
Remove the cls attribute from the Dumper protocol

Where used, in recursive types, get_key() can be used instead.

4 years agoRename adapt.Format to PyFormat
Daniele Varrazzo [Sat, 10 Jul 2021 15:42:30 +0000 (17:42 +0200)] 
Rename adapt.Format to PyFormat

4 years agoAdd Dumper protocol
Daniele Varrazzo [Sat, 10 Jul 2021 15:13:21 +0000 (17:13 +0200)] 
Add Dumper protocol

The presence of this protocol allows to implement custom dumper that
don't inherit from psycopg ones and still be statically checked.

4 years agoDon't chain exceptions on pool timeout
Daniele Varrazzo [Sat, 10 Jul 2021 13:09:22 +0000 (15:09 +0200)] 
Don't chain exceptions on pool timeout

4 years agoCleanup of install docs
Daniele Varrazzo [Wed, 30 Jun 2021 16:05:22 +0000 (17:05 +0100)] 
Cleanup of install docs

4 years agoMore terse import error of the requested implementation
Daniele Varrazzo [Wed, 30 Jun 2021 16:04:42 +0000 (17:04 +0100)] 
More terse import error of the requested implementation

4 years agoCleanup of metadata and readme presented on PyPI
Daniele Varrazzo [Wed, 30 Jun 2021 16:04:19 +0000 (17:04 +0100)] 
Cleanup of metadata and readme presented on PyPI

4 years agoNote in the first docs example that the module name is psycopg
Daniele Varrazzo [Wed, 30 Jun 2021 11:21:11 +0000 (12:21 +0100)] 
Note in the first docs example that the module name is psycopg

4 years agoBump to version 3.0.dev0 to release testing packages 3.0.dev0
Daniele Varrazzo [Wed, 30 Jun 2021 11:14:25 +0000 (12:14 +0100)] 
Bump to version 3.0.dev0 to release testing packages

4 years agoAdd workflow to create sdist packages
Daniele Varrazzo [Wed, 30 Jun 2021 01:59:15 +0000 (02:59 +0100)] 
Add workflow to create sdist packages

4 years agoMerge branch 'cibuildwheel'
Daniele Varrazzo [Wed, 30 Jun 2021 00:49:30 +0000 (01:49 +0100)] 
Merge branch 'cibuildwheel'