]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
4 years agoAdd tests for the Shapely adapter based on PostGIS
Jacopo Farina [Wed, 15 Sep 2021 13:38:25 +0000 (15:38 +0200)] 
Add tests for the Shapely adapter based on PostGIS

4 years agoMake binary dumper the default one
Jacopo Farina [Wed, 15 Sep 2021 11:17:23 +0000 (13:17 +0200)] 
Make binary dumper the default one

The latest registered dumper is the one used by default if the %s
placeholder is used in a query. The binary one is preferred.

4 years agoRename module from types.geometry to types.shapely
Jacopo Farina [Wed, 15 Sep 2021 11:10:22 +0000 (13:10 +0200)] 
Rename module from types.geometry to types.shapely

In case in the future further adapters for geometry types are added,
this naming makes more sense

4 years agoHandle memoriview and buffer data as well as bytes, better import
Jacopo Farina [Tue, 14 Sep 2021 09:24:13 +0000 (11:24 +0200)] 
Handle memoriview and buffer data as well as bytes, better import

4 years agoAdd Shapely-based adapter for PostGIS geometry, and docs
Jacopo Farina [Tue, 14 Sep 2021 09:14:26 +0000 (11:14 +0200)] 
Add Shapely-based adapter for PostGIS geometry, and docs

Previous commits were messy due to some rebase gone wrong, moved them to
a single commit

4 years agoUse class instead of type() to create the specific hstore dumper
Daniele Varrazzo [Tue, 21 Sep 2021 16:03:52 +0000 (17:03 +0100)] 
Use class instead of type() to create the specific hstore dumper

The name is not variable so it's not useful to use the less common
constructor.

4 years agoRaise a friendly exception if None is passed to register_*()
Daniele Varrazzo [Tue, 21 Sep 2021 15:55:52 +0000 (16:55 +0100)] 
Raise a friendly exception if None is passed to register_*()

The most likely cause is fetching info and the object is not found.
Suggest that that's what happened instead of throwing an AttributeError
or anything else random.

4 years agoFix missing assert in test
Daniele Varrazzo [Tue, 21 Sep 2021 14:53:08 +0000 (15:53 +0100)] 
Fix missing assert in test

Add acopy() helper to write async tests more similar to sync ones

4 years agoDo not use the extended protocol in COPY
Daniele Varrazzo [Fri, 3 Sep 2021 16:39:09 +0000 (18:39 +0200)] 
Do not use the extended protocol in COPY

Error recovery is reported to be problematic (see #78).

Close #82.

4 years agoDrop rename of PyFormat import in tests
Daniele Varrazzo [Wed, 15 Sep 2021 18:19:26 +0000 (19:19 +0100)] 
Drop rename of PyFormat import in tests

It was to minimise a diff when it got renamed, but it's confusing using
old tests as template for new ones.

4 years agoChange macOS name in installation documentation
Artur Dryomov [Tue, 14 Sep 2021 09:37:55 +0000 (12:37 +0300)] 
Change macOS name in installation documentation

4 years agoFix docs case typo
Daniele Varrazzo [Mon, 13 Sep 2021 21:07:03 +0000 (23:07 +0200)] 
Fix docs case typo

4 years agoSmall adjustments suggested by pyupgrade
Daniele Varrazzo [Mon, 13 Sep 2021 15:56:50 +0000 (17:56 +0200)] 
Small adjustments suggested by pyupgrade

4 years agoDon't pass "utf8" to str.encode() and bytes.decode()
Daniele Varrazzo [Sun, 12 Sep 2021 22:25:57 +0000 (00:25 +0200)] 
Don't pass "utf8" to str.encode() and bytes.decode()

"utf8" is the default: not passing it is marginally faster.

4 years agoRun DNS-related tests in CI
Daniele Varrazzo [Sun, 12 Sep 2021 00:31:44 +0000 (02:31 +0200)] 
Run DNS-related tests in CI

4 years agoMake sure tests can run without installing psycopg_pool
Daniele Varrazzo [Sun, 12 Sep 2021 00:26:02 +0000 (02:26 +0200)] 
Make sure tests can run without installing psycopg_pool

4 years agoImprove the docs index page
Daniele Varrazzo [Wed, 8 Sep 2021 21:22:29 +0000 (23:22 +0200)] 
Improve the docs index page

4 years agodocs: wordsmith
Daniele Varrazzo [Wed, 8 Sep 2021 21:19:20 +0000 (23:19 +0200)] 
docs: wordsmith

4 years agoBump furo version for docs building
Daniele Varrazzo [Wed, 8 Sep 2021 20:33:50 +0000 (22:33 +0200)] 
Bump furo version for docs building

Provides fix for https://github.com/pradyunsg/furo/discussions/240

4 years agoImprove migration docs
Daniele Varrazzo [Wed, 8 Sep 2021 20:33:36 +0000 (22:33 +0200)] 
Improve migration docs

4 years agoMerge branch 'build-src-wheels'
Daniele Varrazzo [Fri, 3 Sep 2021 22:24:39 +0000 (00:24 +0200)] 
Merge branch 'build-src-wheels'

4 years agoUnify sdist and wheel packages building
Daniele Varrazzo [Fri, 3 Sep 2021 22:04:17 +0000 (00:04 +0200)] 
Unify sdist and wheel packages building

4 years agoDrop building C wheel package
Daniele Varrazzo [Fri, 3 Sep 2021 21:57:48 +0000 (23:57 +0200)] 
Drop building C wheel package

It cannot be distributed on PyPI, and it makes sense that it's built on
the client, so just distribute the .tar.gz.

4 years agoBuild pacakges wheels 3.0.beta1-wheel
Daniele Varrazzo [Fri, 3 Sep 2021 16:49:00 +0000 (18:49 +0200)] 
Build pacakges wheels

Not doing so, packages will be built by the clients on install. Not
nice.

4 years agoAdd vim folds to package workflow
Daniele Varrazzo [Fri, 3 Sep 2021 16:48:31 +0000 (18:48 +0200)] 
Add vim folds to package workflow

4 years agoFixed @Intevation url in the backers file
Daniele Varrazzo [Fri, 3 Sep 2021 12:55:02 +0000 (14:55 +0200)] 
Fixed @Intevation url in the backers file

4 years agoFix requirement for furo
Daniele Varrazzo [Fri, 3 Sep 2021 00:38:32 +0000 (02:38 +0200)] 
Fix requirement for furo

4 years agoFix xml dumper example
Daniele Varrazzo [Tue, 31 Aug 2021 21:28:49 +0000 (23:28 +0200)] 
Fix xml dumper example

Bad query, use type name instead of oid.

4 years agoUpgrade Furo docs theme to stable version
Daniele Varrazzo [Tue, 31 Aug 2021 18:24:21 +0000 (20:24 +0200)] 
Upgrade Furo docs theme to stable version

The previous version produced white flash changing page in dark theme.

https://github.com/pradyunsg/furo/discussions/230

(at least on my laptop - the problem might be compound with some
extension, because others couldn't reproduce the issue, and Furo author
says it only happened on long pages for them).

4 years agoFix tests retry if the failure leaves the connection in bad state
Daniele Varrazzo [Tue, 31 Aug 2021 14:42:07 +0000 (16:42 +0200)] 
Fix tests retry if the failure leaves the connection in bad state

4 years agoDocs typo: several way -> ways
Daniele Varrazzo [Mon, 30 Aug 2021 13:41:38 +0000 (15:41 +0200)] 
Docs typo: several way -> ways

4 years agoFix async SRV resolution
Daniele Varrazzo [Mon, 30 Aug 2021 05:51:30 +0000 (07:51 +0200)] 
Fix async SRV resolution

Also use separate fixtures to mock sync and async DNS resolution.

4 years agoBump to next beta release
Daniele Varrazzo [Mon, 30 Aug 2021 04:35:34 +0000 (06:35 +0200)] 
Bump to next beta release

4 years agoInstructions for PyPI installation in the readme
Daniele Varrazzo [Mon, 30 Aug 2021 04:34:40 +0000 (06:34 +0200)] 
Instructions for PyPI installation in the readme

4 years agoUpdate classifiers to beta state
Daniele Varrazzo [Mon, 30 Aug 2021 04:32:20 +0000 (06:32 +0200)] 
Update classifiers to beta state

4 years agoUpdate install docs to point at PyPI
Daniele Varrazzo [Mon, 30 Aug 2021 04:32:05 +0000 (06:32 +0200)] 
Update install docs to point at PyPI

4 years agoBump version to beta 1 3.0.beta1
Daniele Varrazzo [Mon, 30 Aug 2021 03:24:13 +0000 (05:24 +0200)] 
Bump version to beta 1

4 years agoAdd function to perform SRV DNS resolution
Daniele Varrazzo [Mon, 30 Aug 2021 03:21:53 +0000 (05:21 +0200)] 
Add function to perform SRV DNS resolution

4 years agoAllow to intermix local addresses with DNS async resolution
Daniele Varrazzo [Sun, 29 Aug 2021 22:01:15 +0000 (00:01 +0200)] 
Allow to intermix local addresses with DNS async resolution

4 years agoPoint out in async connection about blocking DNS and solution
Daniele Varrazzo [Mon, 30 Aug 2021 03:31:32 +0000 (05:31 +0200)] 
Point out in async connection about blocking DNS and solution

4 years agoRename _dns docs page to dns as non compatible with GitHub pages
Daniele Varrazzo [Sun, 29 Aug 2021 21:41:54 +0000 (23:41 +0200)] 
Rename _dns docs page to dns as non compatible with GitHub pages

4 years agoMerge branch 'async-dns-dnspython'
Daniele Varrazzo [Sun, 29 Aug 2021 21:33:26 +0000 (23:33 +0200)] 
Merge branch 'async-dns-dnspython'

4 years agoAdd _dns module docs
Daniele Varrazzo [Sun, 29 Aug 2021 16:31:40 +0000 (18:31 +0200)] 
Add _dns module docs

4 years agoKeep env vars into account in async DNS resolutions
Daniele Varrazzo [Sun, 29 Aug 2021 16:11:20 +0000 (18:11 +0200)] 
Keep env vars into account in async DNS resolutions

4 years agoAdd _dns module
Daniele Varrazzo [Sun, 22 Aug 2021 04:03:18 +0000 (06:03 +0200)] 
Add _dns module

Add a function to allow async resolution of the `host` entry in the
connection string.

The module is experimental and depends on the `dnspython` external
package, which is currently not installed as a dependency.

4 years agoSmall cleanup to conninfo docs
Daniele Varrazzo [Sun, 29 Aug 2021 17:00:43 +0000 (19:00 +0200)] 
Small cleanup to conninfo docs

4 years agoAdd docs for conninfo module
Daniele Varrazzo [Sun, 29 Aug 2021 16:55:08 +0000 (18:55 +0200)] 
Add docs for conninfo module

4 years agoChange link to postgres docs from v13 to current
Daniele Varrazzo [Sun, 29 Aug 2021 16:12:42 +0000 (18:12 +0200)] 
Change link to postgres docs from v13 to current

4 years agoAdd pg_lsn to the builtin types registry
Daniele Varrazzo [Sun, 29 Aug 2021 06:47:26 +0000 (08:47 +0200)] 
Add pg_lsn to the builtin types registry

4 years agoUpdate errors table to PostgreSQL 14
Daniele Varrazzo [Sun, 29 Aug 2021 06:15:05 +0000 (08:15 +0200)] 
Update errors table to PostgreSQL 14

4 years agoReorder statements in a function where black didn't do a good job
Daniele Varrazzo [Sun, 29 Aug 2021 05:59:24 +0000 (07:59 +0200)] 
Reorder statements in a function where black didn't do a good job

4 years agomark compat module internal
Daniele Varrazzo [Sun, 29 Aug 2021 05:32:50 +0000 (07:32 +0200)] 
mark compat module internal

4 years agoImprove TypeRegistry docs
Daniele Varrazzo [Sat, 28 Aug 2021 16:46:03 +0000 (18:46 +0200)] 
Improve TypeRegistry docs

4 years agoAdd XML Dumper example
Daniele Varrazzo [Sat, 28 Aug 2021 16:36:04 +0000 (18:36 +0200)] 
Add XML Dumper example

4 years agoMake TEXT the default format for psycopg.adapt.Dumper and Loader
Daniele Varrazzo [Sat, 28 Aug 2021 16:18:35 +0000 (18:18 +0200)] 
Make TEXT the default format for psycopg.adapt.Dumper and Loader

4 years agoAdd UUID, network examples in the docs
Daniele Varrazzo [Sat, 28 Aug 2021 15:23:29 +0000 (17:23 +0200)] 
Add UUID, network examples in the docs

4 years agoAdd links out of the basic usage page towards more advanced topics
Daniele Varrazzo [Sat, 28 Aug 2021 15:18:09 +0000 (17:18 +0200)] 
Add links out of the basic usage page towards more advanced topics

4 years agoImprove rows documentation
Daniele Varrazzo [Sat, 28 Aug 2021 14:35:39 +0000 (16:35 +0200)] 
Improve rows documentation

Add api section, move from examples to theory instead of the other way
around.

4 years agoxml adaptation example and more about types registry
Daniele Varrazzo [Sat, 28 Aug 2021 05:38:53 +0000 (07:38 +0200)] 
xml adaptation example and more about types registry

4 years agoAdd composite types adaptation docs
Daniele Varrazzo [Sat, 28 Aug 2021 04:59:48 +0000 (06:59 +0200)] 
Add composite types adaptation docs

4 years agoFix type var annotation
Daniele Varrazzo [Sat, 28 Aug 2021 04:10:49 +0000 (06:10 +0200)] 
Fix type var annotation

4 years agoAdd hstore docs
Daniele Varrazzo [Sat, 28 Aug 2021 04:10:41 +0000 (06:10 +0200)] 
Add hstore docs

4 years agoAdd documentation for range types
Daniele Varrazzo [Sat, 28 Aug 2021 03:51:16 +0000 (05:51 +0200)] 
Add documentation for range types

4 years agoRegister array dumpers for oid lookups
Daniele Varrazzo [Sat, 28 Aug 2021 03:21:20 +0000 (05:21 +0200)] 
Register array dumpers for oid lookups

This allows, among other things, to dump composite types containing array
in binary.

4 years agoAdd test to verify empty ranges can be copied in ok
Daniele Varrazzo [Sat, 28 Aug 2021 02:12:08 +0000 (04:12 +0200)] 
Add test to verify empty ranges can be copied in ok

4 years agoFix shortcuts examples
Daniele Varrazzo [Sat, 28 Aug 2021 01:32:42 +0000 (03:32 +0200)] 
Fix shortcuts examples

4 years agoMore standard adaptation docs
Daniele Varrazzo [Sat, 28 Aug 2021 01:32:21 +0000 (03:32 +0200)] 
More standard adaptation docs

4 years agoDrop docs topic I won't write
Daniele Varrazzo [Fri, 27 Aug 2021 22:51:44 +0000 (00:51 +0200)] 
Drop docs topic I won't write

4 years agoMerge branch 'dump-by-oid'
Daniele Varrazzo [Fri, 27 Aug 2021 22:51:22 +0000 (00:51 +0200)] 
Merge branch 'dump-by-oid'

4 years agoAdd dumping by oid in the C implementation too
Daniele Varrazzo [Fri, 27 Aug 2021 22:20:51 +0000 (00:20 +0200)] 
Add dumping by oid in the C implementation too

4 years agoReturn only the params from Transformer.dump_sequence()
Daniele Varrazzo [Fri, 27 Aug 2021 16:16:33 +0000 (18:16 +0200)] 
Return only the params from Transformer.dump_sequence()

The types and formats can be read as object attributes.

4 years agoReplace git_row_types() with get_dumper_types/get_loader_types()
Daniele Varrazzo [Fri, 27 Aug 2021 12:50:41 +0000 (14:50 +0200)] 
Replace git_row_types() with get_dumper_types/get_loader_types()

dump_sequence() can make use of the dumpers pre-set by get_dumper_types()
and is now used in composite binary dump and in binary COPY FROM.

The interface should be better iterated because for the latter use cases
the extra info (oids, formats) are just a waste of resources.

Only the Python implementation has been changed so far, the C
implementation will be changed down the line.

4 years agoUse the composite type info to choose dumpers, instead of the Python type
Daniele Varrazzo [Fri, 27 Aug 2021 01:27:59 +0000 (03:27 +0200)] 
Use the composite type info to choose dumpers, instead of the Python type

This allows to dump composites in binary format without the need to use
object wrappers to specify e.g. the type of integer.

4 years agoAdd mapping oid -> Dumper in AdaptersMap
Daniele Varrazzo [Fri, 27 Aug 2021 00:17:53 +0000 (02:17 +0200)] 
Add mapping oid -> Dumper in AdaptersMap

4 years agoMake Dumper.oid a class attribute for C classes too
Daniele Varrazzo [Thu, 26 Aug 2021 22:20:45 +0000 (00:20 +0200)] 
Make Dumper.oid a class attribute for C classes too

4 years agoMake Dumper.oid a class attribute for every Dumper subclass
Daniele Varrazzo [Thu, 26 Aug 2021 22:01:12 +0000 (00:01 +0200)] 
Make Dumper.oid a class attribute for every Dumper subclass

4 years agoMerge remote-tracking branch 'origin/better-composite'
Daniele Varrazzo [Fri, 27 Aug 2021 22:23:27 +0000 (00:23 +0200)] 
Merge remote-tracking branch 'origin/better-composite'

4 years agoAdd binary composite dumper
Daniele Varrazzo [Thu, 26 Aug 2021 21:39:33 +0000 (23:39 +0200)] 
Add binary composite dumper

4 years agoDrop TypeInfo.async_fetch(), use fetch() for both connection types
Daniele Varrazzo [Thu, 26 Aug 2021 18:58:05 +0000 (20:58 +0200)] 
Drop TypeInfo.async_fetch(), use fetch() for both connection types

4 years agoA more elegant way to customise TypeInfo registration in subclasses
Daniele Varrazzo [Thu, 26 Aug 2021 18:18:57 +0000 (20:18 +0200)] 
A more elegant way to customise TypeInfo registration in subclasses

4 years agoMake register_composite(), register_range() the public interface
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).

4 years agoRegister composite dumper if the factory is a type
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.

4 years agoClean up datetime adaptation docs
Daniele Varrazzo [Thu, 26 Aug 2021 12:51:08 +0000 (14:51 +0200)] 
Clean up datetime adaptation docs

4 years agoDon't use the generic name register_adapters
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...

4 years agoVerify that arrays of binary types dump correctly
Daniele Varrazzo [Thu, 26 Aug 2021 01:14:32 +0000 (03:14 +0200)] 
Verify that arrays of binary types dump correctly

4 years agoMore types adaptation docs
Daniele Varrazzo [Thu, 26 Aug 2021 01:13:56 +0000 (03:13 +0200)] 
More types adaptation docs

4 years agoDrop TODO doc point to something that people can discover themselves
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.

4 years agoAdd binary parameter to cursor.execute()
Daniele Varrazzo [Wed, 25 Aug 2021 17:57:46 +0000 (19:57 +0200)] 
Add binary parameter to cursor.execute()

4 years agoDrop Cursor.pgresult duplication in docs
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.

4 years agoDocument pgconn, pgresult properties
Daniele Varrazzo [Wed, 25 Aug 2021 02:58:24 +0000 (04:58 +0200)] 
Document pgconn, pgresult properties

4 years agoDon't use --no-deps to install the pool package
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).

4 years agoReadmes and metadata cleanup
Daniele Varrazzo [Wed, 25 Aug 2021 02:02:30 +0000 (04:02 +0200)] 
Readmes and metadata cleanup

4 years agoDrop TODO point after understanding that Windows has no IANA db
Daniele Varrazzo [Wed, 25 Aug 2021 01:02:54 +0000 (03:02 +0200)] 
Drop TODO point after understanding that Windows has no IANA db

4 years agoDrop TODO point regarding Travis
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.

4 years agoMerge branch 'array-delim'
Daniele Varrazzo [Wed, 25 Aug 2021 01:05:24 +0000 (03:05 +0200)] 
Merge branch 'array-delim'

4 years agoDump lists keeping the type delimiter into account
Daniele Varrazzo [Tue, 24 Aug 2021 20:55:09 +0000 (22:55 +0200)] 
Dump lists keeping the type delimiter into account

4 years agoLoad arrays of types with delimiters different than comma (e.g. box)
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)

4 years agoAdd "char" data type loading
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.

4 years agoFix typeinfo fetch of alt_name
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.

4 years agoAdd oid to column representation
Daniele Varrazzo [Tue, 24 Aug 2021 19:05:39 +0000 (21:05 +0200)] 
Add oid to column representation