]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
4 years agoAdded timestamp text loading
Daniele Varrazzo [Sun, 18 Oct 2020 16:06:00 +0000 (17:06 +0100)] 
Added timestamp text loading

4 years agoAdded datetime dump
Daniele Varrazzo [Sun, 6 Sep 2020 11:50:12 +0000 (12:50 +0100)] 
Added datetime dump

4 years agoRaise a polite exception for dates >= Y10K
Daniele Varrazzo [Sun, 23 Aug 2020 20:41:15 +0000 (21:41 +0100)] 
Raise a polite exception for dates >= Y10K

4 years agoRaise a polite exception for BC dates
Daniele Varrazzo [Sun, 23 Aug 2020 20:13:34 +0000 (21:13 +0100)] 
Raise a polite exception for BC dates

4 years agoAdded date text loader
Daniele Varrazzo [Sun, 23 Aug 2020 18:20:53 +0000 (19:20 +0100)] 
Added date text loader

THe loader can already deal with all the Postgres DateStyle

4 years agoAdded date text dumper
Daniele Varrazzo [Sun, 23 Aug 2020 17:23:23 +0000 (18:23 +0100)] 
Added date text dumper

4 years agoMerge branch 'json-adapt'
Daniele Varrazzo [Wed, 28 Oct 2020 03:17:47 +0000 (04:17 +0100)] 
Merge branch 'json-adapt'

4 years agoAdded JSON loaders
Daniele Varrazzo [Tue, 27 Oct 2020 18:47:05 +0000 (19:47 +0100)] 
Added JSON loaders

4 years agoAdded tests to verify json dump customisation
Daniele Varrazzo [Tue, 27 Oct 2020 17:35:13 +0000 (18:35 +0100)] 
Added tests to verify json dump customisation

4 years agoAdded json binary dumpers
Daniele Varrazzo [Tue, 27 Oct 2020 16:17:21 +0000 (17:17 +0100)] 
Added json binary dumpers

4 years agoAdded json text dump
Daniele Varrazzo [Tue, 27 Oct 2020 16:09:08 +0000 (17:09 +0100)] 
Added json text dump

4 years agoAdded missing methods to psycopg3.pq.Escaping proto
Daniele Varrazzo [Wed, 28 Oct 2020 00:45:45 +0000 (01:45 +0100)] 
Added missing methods to psycopg3.pq.Escaping proto

4 years ago'psycopg3.transform' module made private
Daniele Varrazzo [Wed, 28 Oct 2020 00:11:39 +0000 (01:11 +0100)] 
'psycopg3.transform' module made private

It's too easy to import psycopg3.transform.Transformer when instead
the C module is the one enabled. This will make some isinstance fail,
and e.g. _connecion_from_context would throw a TypeError.

4 years agoAdded PQescapeString wrapper
Daniele Varrazzo [Tue, 27 Oct 2020 23:32:07 +0000 (00:32 +0100)] 
Added PQescapeString wrapper

`psycopg3.pq.Escaping.escape_string()` can now work without a connection
too, with the limitation explained in the libpq docs.

Also fixed memory leak. Oops.

4 years agoSubclasses of dumpable objects are dumpable too
Daniele Varrazzo [Tue, 27 Oct 2020 17:30:50 +0000 (18:30 +0100)] 
Subclasses of dumpable objects are dumpable too

4 years agoFixed test run on non-local server
Daniele Varrazzo [Tue, 27 Oct 2020 13:44:19 +0000 (14:44 +0100)] 
Fixed test run on non-local server

4 years agoFixed hacking instruction, again
Daniele Varrazzo [Tue, 27 Oct 2020 13:43:56 +0000 (14:43 +0100)] 
Fixed hacking instruction, again

4 years agoAllow multiple commands in _exec_command()
Daniel Fortunov [Thu, 6 Aug 2020 23:09:30 +0000 (00:09 +0100)] 
Allow multiple commands in _exec_command()

4 years agoconnection: Move lock acquisition out of _exec_commit_rollback()
Daniel Fortunov [Sat, 25 Jul 2020 11:36:47 +0000 (12:36 +0100)] 
connection: Move lock acquisition out of _exec_commit_rollback()

4 years agoFixed hacking instructions in readme
Daniele Varrazzo [Mon, 26 Oct 2020 16:40:45 +0000 (17:40 +0100)] 
Fixed hacking instructions in readme

4 years agoConnection encoding renamed to client_encoding
Daniele Varrazzo [Sat, 25 Jul 2020 18:18:15 +0000 (19:18 +0100)] 
Connection encoding renamed to client_encoding

More precise and consistent with set_client_encoding()

4 years agoConnection.encoding made writable again
Daniele Varrazzo [Sat, 25 Jul 2020 11:17:51 +0000 (12:17 +0100)] 
Connection.encoding made writable again

I'm so flipflopping on this...

4 years agoSetting autocommit made thread safe
Daniele Varrazzo [Sat, 25 Jul 2020 10:52:07 +0000 (11:52 +0100)] 
Setting autocommit made thread safe

Using a setter on sync connections, a function on async connections.
Should review why this approach was abandoned for the client encoding,
because it seems working alright.

4 years agotest_ssl_in_use(): Adapt for Windows
Daniel Fortunov [Sun, 19 Jul 2020 23:22:37 +0000 (00:22 +0100)] 
test_ssl_in_use(): Adapt for Windows

4 years agoTrailing comma dropped from where black would reformat
Daniele Varrazzo [Fri, 16 Oct 2020 14:37:05 +0000 (15:37 +0100)] 
Trailing comma dropped from where black would reformat

The changes are detected by black 20.8b1

4 years agoFixed dev mode readme instructions
Daniele Varrazzo [Fri, 16 Oct 2020 14:05:32 +0000 (15:05 +0100)] 
Fixed dev mode readme instructions

4 years agoMerge branch 'simplify-adapt'
Daniele Varrazzo [Sun, 23 Aug 2020 18:24:08 +0000 (19:24 +0100)] 
Merge branch 'simplify-adapt'

4 years agoTransformer._lookup_dumper/loader dropped altogether
Daniele Varrazzo [Fri, 7 Aug 2020 03:14:33 +0000 (04:14 +0100)] 
Transformer._lookup_dumper/loader dropped altogether

4 years agoTransformer.lookup_loader/dumper dropped from interface
Daniele Varrazzo [Fri, 7 Aug 2020 03:00:48 +0000 (04:00 +0100)] 
Transformer.lookup_loader/dumper dropped from interface

4 years agoDropped Transformer.get_load_function
Daniele Varrazzo [Fri, 7 Aug 2020 02:58:52 +0000 (03:58 +0100)] 
Dropped Transformer.get_load_function

4 years agoDropped Transformer.load()
Daniele Varrazzo [Fri, 7 Aug 2020 02:49:20 +0000 (03:49 +0100)] 
Dropped Transformer.load()

4 years agoPyxLoader renamed to CLoader
Daniele Varrazzo [Fri, 7 Aug 2020 02:43:21 +0000 (03:43 +0100)] 
PyxLoader renamed to CLoader

4 years agoAll C loaders converted to the PyxLoader class
Daniele Varrazzo [Fri, 7 Aug 2020 02:38:26 +0000 (03:38 +0100)] 
All C loaders converted to the PyxLoader class

4 years agoUse a C fast path to use the Loader.cload where available
Daniele Varrazzo [Fri, 7 Aug 2020 01:52:14 +0000 (02:52 +0100)] 
Use a C fast path to use the Loader.cload where available

4 years agoDropped unused Transform._oids
Daniele Varrazzo [Fri, 7 Aug 2020 01:20:57 +0000 (02:20 +0100)] 
Dropped unused Transform._oids

4 years agoAdded guard to avoid importing psycog3_c without psycopg3
Daniele Varrazzo [Fri, 7 Aug 2020 00:52:23 +0000 (01:52 +0100)] 
Added guard to avoid importing psycog3_c without psycopg3

Doing so result in mysterious import error.

4 years agoAllow overriding of Py loaders by C loaders
Daniele Varrazzo [Fri, 7 Aug 2020 00:51:29 +0000 (01:51 +0100)] 
Allow overriding of Py loaders by C loaders

Only registering our toy bytea loader for the moment, other will follow
a similar pattern.

4 years agoCreating a Cython Loader with the same interface as Python
Daniele Varrazzo [Thu, 6 Aug 2020 21:22:52 +0000 (22:22 +0100)] 
Creating a Cython Loader with the same interface as Python

Added C implementation of the BinaryByteaLoader to test the interface

4 years agoDropped support for loader functions
Daniele Varrazzo [Thu, 6 Aug 2020 18:52:44 +0000 (19:52 +0100)] 
Dropped support for loader functions

4 years agoAll loader functions converted to classes
Daniele Varrazzo [Thu, 6 Aug 2020 18:41:34 +0000 (19:41 +0100)] 
All loader functions converted to classes

4 years agoDropped Transform.dump_sequence(), Transform.types_sequence()
Daniele Varrazzo [Thu, 6 Aug 2020 02:51:12 +0000 (03:51 +0100)] 
Dropped Transform.dump_sequence(), Transform.types_sequence()

4 years agoDropped Transformer.dump()
Daniele Varrazzo [Thu, 6 Aug 2020 02:29:08 +0000 (03:29 +0100)] 
Dropped Transformer.dump()

4 years agoDropped MaybeOid type and optional second return value from Dumper.dump()
Daniele Varrazzo [Thu, 6 Aug 2020 02:18:53 +0000 (03:18 +0100)] 
Dropped MaybeOid type and optional second return value from Dumper.dump()

4 years agoDropped oids from Transform.dump_sequence() return value
Daniele Varrazzo [Thu, 6 Aug 2020 01:15:52 +0000 (02:15 +0100)] 
Dropped oids from Transform.dump_sequence() return value

4 years agoAdded Transformer.types_sequence
Daniele Varrazzo [Thu, 6 Aug 2020 01:09:35 +0000 (02:09 +0100)] 
Added Transformer.types_sequence

Not entirely sure yet if it will be needed, but this allows to free
dump_sequence() from returning the oids as second argument.

Dropped Transformer.get_dump_function() too.

4 years agoAdded oid property on Dumper object
Daniele Varrazzo [Thu, 6 Aug 2020 00:08:59 +0000 (01:08 +0100)] 
Added oid property on Dumper object

4 years agoDropped use of plain functions to define dumpers
Daniele Varrazzo [Wed, 5 Aug 2020 22:25:56 +0000 (23:25 +0100)] 
Dropped use of plain functions to define dumpers

4 years agoFlake8 configured to deal with the psycopg3 dir
Daniele Varrazzo [Sun, 23 Aug 2020 18:22:29 +0000 (19:22 +0100)] 
Flake8 configured to deal with the psycopg3 dir

4 years agoTest and dev dependencies expressed as extras
Daniele Varrazzo [Sun, 23 Aug 2020 15:41:19 +0000 (16:41 +0100)] 
Test and dev dependencies expressed as extras

4 years agoTest fixed to not assume PID < 65535
Daniele Varrazzo [Sun, 23 Aug 2020 14:50:57 +0000 (15:50 +0100)] 
Test fixed to not assume PID < 65535

5 years agoTests: Create svcconn with autocommit on
Daniel Fortunov [Sun, 26 Jul 2020 01:37:02 +0000 (02:37 +0100)] 
Tests: Create svcconn with autocommit on

So that you don't deadlock the test run if you forget to call commit()

e.g. If you use svcconn to create a test table for use by tests, and
forget to call svcconn.commit(), the first test to (try to) touch the
table will block forever waiting on the svcconn transaction to commit.

5 years agoMore complete string escaping test
Daniele Varrazzo [Sat, 8 Aug 2020 19:55:39 +0000 (20:55 +0100)] 
More complete string escaping test

5 years agoAdded Escaping.escape_string
Daniele Varrazzo [Sat, 8 Aug 2020 19:42:00 +0000 (20:42 +0100)] 
Added Escaping.escape_string

5 years agoAdded Escaping.escape_identifier
Daniele Varrazzo [Sat, 8 Aug 2020 18:31:43 +0000 (19:31 +0100)] 
Added Escaping.escape_identifier

5 years agoAdded Escaping.escape_literal
Daniele Varrazzo [Sat, 8 Aug 2020 18:07:52 +0000 (19:07 +0100)] 
Added Escaping.escape_literal

5 years agoIgnore html files generated by Cython
Daniele Varrazzo [Sat, 8 Aug 2020 18:05:32 +0000 (19:05 +0100)] 
Ignore html files generated by Cython

5 years agoDon't be so eager to execute 'begin'
Daniel Fortunov [Thu, 6 Aug 2020 23:48:25 +0000 (00:48 +0100)] 
Don't be so eager to execute 'begin'

Only execute an automatic 'begin' statement if the TransactionStatus is
IDLE, so that a failure to execute 'begin' doesn't overshadow a failure
to execute a user query.

5 years agoUpdate pytest to v6
Daniele Varrazzo [Wed, 5 Aug 2020 01:30:47 +0000 (02:30 +0100)] 
Update pytest to v6

5 years agoCreate two different python distributions in the project
Daniele Varrazzo [Sat, 25 Jul 2020 23:54:32 +0000 (00:54 +0100)] 
Create two different python distributions in the project

The psycopg3 package is pure Python and doesn't depend on Cython, the
psycopg3_c package is entirely optional and depends on the former.

Tox had to be split, because it gets confused by the presence of the
top-level pyproject.toml, which is there only to configure black.

5 years agoDropped unused function
Daniele Varrazzo [Fri, 3 Jul 2020 09:12:37 +0000 (21:12 +1200)] 
Dropped unused function

5 years agoAdded row-by-row copy in
Daniele Varrazzo [Tue, 30 Jun 2020 18:41:50 +0000 (06:41 +1200)] 
Added row-by-row copy in

5 years agoHandle a bad command passed to copy
Daniele Varrazzo [Tue, 30 Jun 2020 17:58:08 +0000 (05:58 +1200)] 
Handle a bad command passed to copy

5 years agoSome mypy cleanup
Daniele Varrazzo [Wed, 24 Jun 2020 14:17:20 +0000 (02:17 +1200)] 
Some mypy cleanup

5 years agoUse a standard mypy config file
Daniele Varrazzo [Wed, 24 Jun 2020 11:12:17 +0000 (23:12 +1200)] 
Use a standard mypy config file

It integrates better with the editor (trying ALE on Vim).
Newer mypy version allows to hide the file.

5 years agoDropped attempt of read support
Daniele Varrazzo [Wed, 24 Jun 2020 08:44:32 +0000 (20:44 +1200)] 
Dropped attempt of read support

It doesn't add anything to selecting, except that it cannot work as type
info is not available on copy. Furthermore it was based on the broken
assumption that copy sends generic buffers, whereas it sends entire
rows, so it was uselessly complicated.

5 years agoAllow passing a str buffer to copy
Daniele Varrazzo [Wed, 24 Jun 2020 08:35:58 +0000 (20:35 +1200)] 
Allow passing a str buffer to copy

5 years agoRaise error messages in the connection encoding
Daniele Varrazzo [Tue, 23 Jun 2020 11:17:10 +0000 (23:17 +1200)] 
Raise error messages in the connection encoding

5 years agoAdded reading from copy
Daniele Varrazzo [Tue, 23 Jun 2020 10:31:40 +0000 (22:31 +1200)] 
Added reading from copy

5 years agoAdded wrapper for libpq function PQgetCopyData
Daniele Varrazzo [Tue, 23 Jun 2020 08:28:27 +0000 (20:28 +1200)] 
Added wrapper for libpq function PQgetCopyData

5 years agoAdded context manager interface to copy objects
Daniele Varrazzo [Mon, 22 Jun 2020 09:41:58 +0000 (21:41 +1200)] 
Added context manager interface to copy objects

5 years agoAdded basic copy to server in blocks
Daniele Varrazzo [Mon, 22 Jun 2020 07:32:34 +0000 (19:32 +1200)] 
Added basic copy to server in blocks

5 years agoImplemented rows and fields splitting on text copy
Daniele Varrazzo [Sun, 21 Jun 2020 10:15:15 +0000 (22:15 +1200)] 
Implemented rows and fields splitting on text copy

5 years agoAdded pq.PGresult.set_attributes() method
Daniele Varrazzo [Sun, 21 Jun 2020 07:01:32 +0000 (19:01 +1200)] 
Added pq.PGresult.set_attributes() method

5 years agoSketching an interface for a copy object
Daniele Varrazzo [Sun, 21 Jun 2020 05:51:11 +0000 (17:51 +1200)] 
Sketching an interface for a copy object

5 years agobinary attribute replaced by format
Daniele Varrazzo [Sun, 21 Jun 2020 04:38:50 +0000 (16:38 +1200)] 
binary attribute replaced by format

5 years agoAdded mapping from sqlstate to error classes
Daniele Varrazzo [Sat, 30 May 2020 21:14:50 +0000 (09:14 +1200)] 
Added mapping from sqlstate to error classes

5 years agoAdded query canceling
Daniele Varrazzo [Sat, 30 May 2020 18:00:27 +0000 (06:00 +1200)] 
Added query canceling

5 years agoAdded notification handling in connections
Daniele Varrazzo [Mon, 25 May 2020 06:13:44 +0000 (18:13 +1200)] 
Added notification handling in connections

Added both a callback systen and an explicit generator. I'll share the
design on the ML and ask for comments.

5 years agoAdded PQnotifies libpq wrapper
Daniele Varrazzo [Sun, 24 May 2020 05:43:27 +0000 (17:43 +1200)] 
Added PQnotifies libpq wrapper

5 years agoAdded further tests about dsn parsing
Daniele Varrazzo [Sat, 23 May 2020 05:18:58 +0000 (17:18 +1200)] 
Added further tests about dsn parsing

5 years agoClose the connection on GC only if created in the same process
Daniele Varrazzo [Sat, 23 May 2020 04:50:41 +0000 (16:50 +1200)] 
Close the connection on GC only if created in the same process

Fix the same issue reported in psycopg/psycopg2#829.

5 years agoMoving concurrency tests in their own files
Daniele Varrazzo [Sat, 23 May 2020 04:15:08 +0000 (16:15 +1200)] 
Moving concurrency tests in their own files

These tests are verbose, slow, and don't test the interface, rather the
behaviour, in peculiar cases.

Some test modules names moved to keep related tested objects together.

5 years agoDropped pq fixture
Daniele Varrazzo [Sat, 23 May 2020 03:36:15 +0000 (15:36 +1200)] 
Dropped pq fixture

Just use the module as a normal program would to.

5 years agoAdded public pgconn_ptr, pgresult_ptr attributes
Daniele Varrazzo [Sat, 23 May 2020 03:08:34 +0000 (15:08 +1200)] 
Added public pgconn_ptr, pgresult_ptr attributes

5 years agoSmaller init function using a partial instead of a closure
Daniele Varrazzo [Sat, 23 May 2020 03:07:43 +0000 (15:07 +1200)] 
Smaller init function using a partial instead of a closure

5 years agoAcept string subtypes as connection string
Daniele Varrazzo [Sat, 23 May 2020 01:29:15 +0000 (13:29 +1200)] 
Acept string subtypes as connection string

5 years agoAdded a few concurrency tests
Daniele Varrazzo [Fri, 22 May 2020 09:03:58 +0000 (21:03 +1200)] 
Added a few concurrency tests

5 years agoUsing pytest-asyncio instead of our thing to run async tests
Daniele Varrazzo [Fri, 22 May 2020 17:44:46 +0000 (05:44 +1200)] 
Using pytest-asyncio instead of our thing to run async tests

5 years agoUse severity instead on severity_nonlocalized in tests
Daniele Varrazzo [Fri, 22 May 2020 17:14:54 +0000 (05:14 +1200)] 
Use severity instead on severity_nonlocalized in tests

The attr is not available on PG 9.5

5 years agoMake sure connections and cursors can be gc'd correctly
Daniele Varrazzo [Fri, 22 May 2020 06:32:03 +0000 (18:32 +1200)] 
Make sure connections and cursors can be gc'd correctly

5 years agoAdded a few tests around connection encoding
Daniele Varrazzo [Fri, 22 May 2020 06:16:03 +0000 (18:16 +1200)] 
Added a few tests around connection encoding

5 years agoMake sure notices are enabled in test db
Daniele Varrazzo [Fri, 22 May 2020 16:52:38 +0000 (04:52 +1200)] 
Make sure notices are enabled in test db

5 years agoNotice handler renamed to notice callback
Daniele Varrazzo [Fri, 22 May 2020 05:40:46 +0000 (17:40 +1200)] 
Notice handler renamed to notice callback

5 years agoAdded Diagnostic object
Daniele Varrazzo [Fri, 22 May 2020 04:51:59 +0000 (16:51 +1200)] 
Added Diagnostic object

Use Diagnostic as exception .diag attribute and pgresult wrapper in
notices.

5 years agoAdded notification handlers on connection objects
Daniele Varrazzo [Thu, 21 May 2020 17:56:16 +0000 (05:56 +1200)] 
Added notification handlers on connection objects

5 years agoAdded notice handler to pq.PGconn
Daniele Varrazzo [Thu, 21 May 2020 16:54:40 +0000 (04:54 +1200)] 
Added notice handler to pq.PGconn

5 years agoTest what happens if a connection is broken
Daniele Varrazzo [Thu, 21 May 2020 06:03:36 +0000 (18:03 +1200)] 
Test what happens if a connection is broken

5 years agoFixed testing instruction in readme
Daniele Varrazzo [Thu, 21 May 2020 06:03:04 +0000 (18:03 +1200)] 
Fixed testing instruction in readme

5 years agoDropped connection's encode/decode methods
Daniele Varrazzo [Thu, 21 May 2020 05:47:11 +0000 (17:47 +1200)] 
Dropped connection's encode/decode methods

5 years agoAdded hacking info to readme
Daniele Varrazzo [Thu, 21 May 2020 04:49:07 +0000 (16:49 +1200)] 
Added hacking info to readme

tox definitions and tools configurations tweaked to work out of the box.

Close #3