]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
4 years agoFuro style tweaked
Daniele Varrazzo [Wed, 25 Nov 2020 20:24:29 +0000 (20:24 +0000)] 
Furo style tweaked

- non smaller font in admonitions
- rubric styled.

4 years agoFix #13 Use a responsive docs theme
Paolo Melchiorre [Wed, 25 Nov 2020 16:00:41 +0000 (17:00 +0100)] 
Fix #13 Use a responsive docs theme

4 years agoAdapt find_library() call to find libpq.dll on Windows
Daniel Fortunov [Sun, 19 Jul 2020 23:19:21 +0000 (00:19 +0100)] 
Adapt find_library() call to find libpq.dll on Windows

4 years agoRaise TypeError attempting to use a Copy context more than once
Daniele Varrazzo [Tue, 24 Nov 2020 12:46:41 +0000 (12:46 +0000)] 
Raise TypeError attempting to use a Copy context more than once

See #10

4 years agoMake sure transaction blocks cannot be used more than once
Daniele Varrazzo [Tue, 24 Nov 2020 12:26:18 +0000 (12:26 +0000)] 
Make sure transaction blocks cannot be used more than once

See #12

4 years agoFix docs generation to avoid getting confused by __module__ rewritten
Daniele Varrazzo [Tue, 24 Nov 2020 03:13:35 +0000 (03:13 +0000)] 
Fix docs generation to avoid getting confused by __module__ rewritten

Autodoc features which need the original module get confused, so e.g. pq
enum members or Notify attribute docs are lost if not fixed.

4 years agoOther classes have their __module__ specified
Daniele Varrazzo [Tue, 24 Nov 2020 02:07:00 +0000 (02:07 +0000)] 
Other classes have their __module__ specified

These required jumping through hoop to have mypy and documentation
agreeing, now it's more natural.

4 years agopq enums __module__ changed to psycopg3.pq
Daniele Varrazzo [Tue, 24 Nov 2020 01:41:36 +0000 (01:41 +0000)] 
pq enums __module__ changed to psycopg3.pq

I have found cases of its writability in the stdlib, so I'm satisfied it
can be done.

4 years agoImport pq enums in modules where they are used
Daniele Varrazzo [Tue, 24 Nov 2020 01:18:57 +0000 (01:18 +0000)] 
Import pq enums in modules where they are used

4 years agoCall the params params, not vars
Daniele Varrazzo [Tue, 24 Nov 2020 00:29:13 +0000 (00:29 +0000)] 
Call the params params, not vars

4 years agoQueries modume moved out of utils package
Daniele Varrazzo [Tue, 24 Nov 2020 00:11:44 +0000 (00:11 +0000)] 
Queries modume moved out of utils package

4 years agoAdded some docs about adaptation
Daniele Varrazzo [Mon, 23 Nov 2020 23:53:25 +0000 (23:53 +0000)] 
Added some docs about adaptation

4 years agoFixed broken tests after fixing async connection discrepancies
Daniele Varrazzo [Mon, 23 Nov 2020 15:27:37 +0000 (15:27 +0000)] 
Fixed broken tests after fixing async connection discrepancies

4 years agoFixed tiny diffreences in behaviour between sync and async code
Daniele Varrazzo [Mon, 23 Nov 2020 15:11:44 +0000 (15:11 +0000)] 
Fixed tiny diffreences in behaviour between sync and async code

4 years agoRemove obsolete references to Transaction.Rollback
Daniel Fortunov [Mon, 23 Nov 2020 08:08:46 +0000 (08:08 +0000)] 
Remove obsolete references to Transaction.Rollback

Rollback exception is no longer available on the Transaction object.

4 years agoAdded Cursor.query and params.
Daniele Varrazzo [Mon, 23 Nov 2020 08:44:46 +0000 (08:44 +0000)] 
Added Cursor.query and params.

4 years agoDropped params from Cursor.copy()
Daniele Varrazzo [Mon, 23 Nov 2020 08:43:56 +0000 (08:43 +0000)] 
Dropped params from Cursor.copy()

Never tested... and they don't work.

4 years agoAdded some documentation on the adaptation system
Daniele Varrazzo [Mon, 23 Nov 2020 07:14:17 +0000 (07:14 +0000)] 
Added some documentation on the adaptation system

4 years agoAdded initial docs for psycopg3.pq module
Daniele Varrazzo [Mon, 23 Nov 2020 05:28:43 +0000 (05:28 +0000)] 
Added initial docs for psycopg3.pq module

4 years agoAdded installation instructions including the binary package
Daniele Varrazzo [Mon, 23 Nov 2020 05:23:48 +0000 (05:23 +0000)] 
Added installation instructions including the binary package

4 years agoUse the build script to build source packages too
Daniele Varrazzo [Sun, 22 Nov 2020 23:39:09 +0000 (23:39 +0000)] 
Use the build script to build source packages too

4 years agoCreate the psycopg3-binary package
Daniele Varrazzo [Sun, 22 Nov 2020 21:51:20 +0000 (21:51 +0000)] 
Create the psycopg3-binary package

4 years agoAdded in-progress script to build wheel packages
Daniele Varrazzo [Sun, 22 Nov 2020 21:37:53 +0000 (21:37 +0000)] 
Added in-progress script to build wheel packages

4 years agoPure Python implementation called 'python', not 'ctypes'
Daniele Varrazzo [Sun, 22 Nov 2020 18:46:55 +0000 (18:46 +0000)] 
Pure Python implementation called 'python', not 'ctypes'

4 years agoUse "pip install psycogp3[c]" to install the C extension
Daniele Varrazzo [Sun, 22 Nov 2020 18:36:41 +0000 (18:36 +0000)] 
Use "pip install psycogp3[c]" to install the C extension

4 years agoMerge branch 'c-dumpers'
Daniele Varrazzo [Sun, 22 Nov 2020 17:44:20 +0000 (17:44 +0000)] 
Merge branch 'c-dumpers'

4 years agoCursor.callproc dropped
Daniele Varrazzo [Sun, 22 Nov 2020 17:28:36 +0000 (17:28 +0000)] 
Cursor.callproc dropped

The method has a simplistic semantic which doesn't account for
PostgreSQL positional parameters, procedures, set-returning functions.
Users can use a normal `Cursor.execute()` with SELECT
function_name(...)` or CALL procedure_name(...)` instead.

4 years agoApi docs and typing system made consistent
Daniele Varrazzo [Sun, 22 Nov 2020 16:16:12 +0000 (16:16 +0000)] 
Api docs and typing system made consistent

Top-level objects are annotated as coming from the main package: this
way the documentation can link them consistently to where they are
documented (e.g. `Connection` is `psycopg3.Connection`, not
`psycopg3.connection.Connection`) and MyPy is happy too.

4 years agoCursor.connection made a read-only property
Daniele Varrazzo [Sun, 22 Nov 2020 16:15:02 +0000 (16:15 +0000)] 
Cursor.connection made a read-only property

4 years agoDropped "-> None" from function returning no result in docs
Daniele Varrazzo [Sun, 22 Nov 2020 16:13:31 +0000 (16:13 +0000)] 
Dropped "-> None" from function returning no result in docs

4 years agoAdded errors module documentation
Daniele Varrazzo [Sun, 22 Nov 2020 04:32:01 +0000 (04:32 +0000)] 
Added errors module documentation

4 years agoAdded documentation for the `sql` module
Daniele Varrazzo [Sun, 22 Nov 2020 02:33:36 +0000 (02:33 +0000)] 
Added documentation for the `sql` module

4 years agoAdded C string dumpers
Daniele Varrazzo [Sat, 21 Nov 2020 23:09:16 +0000 (23:09 +0000)] 
Added C string dumpers

4 years agoC Dumpers and Loaders attributes readable from Python
Daniele Varrazzo [Sat, 21 Nov 2020 23:08:36 +0000 (23:08 +0000)] 
C Dumpers and Loaders attributes readable from Python

4 years agoUse the right class instantiating a dumper on a subclass
Daniele Varrazzo [Sat, 21 Nov 2020 23:07:31 +0000 (23:07 +0000)] 
Use the right class instantiating a dumper on a subclass

4 years agoAdded oid constants in cython extension
Daniele Varrazzo [Sat, 21 Nov 2020 21:38:21 +0000 (21:38 +0000)] 
Added oid constants in cython extension

4 years agoAdded C bool dumpers (text, binary)
Daniele Varrazzo [Sat, 21 Nov 2020 20:33:51 +0000 (20:33 +0000)] 
Added C bool dumpers (text, binary)

4 years agoAdded C implementation of int dumpers (text, binary)
Daniele Varrazzo [Sat, 21 Nov 2020 20:17:26 +0000 (20:17 +0000)] 
Added C implementation of int dumpers (text, binary)

4 years agos/loaders/adapters/ where there will be dumpers too
Daniele Varrazzo [Sat, 21 Nov 2020 17:23:27 +0000 (17:23 +0000)] 
s/loaders/adapters/ where there will be dumpers too

4 years agoDocs cleanup
Daniele Varrazzo [Fri, 20 Nov 2020 03:50:19 +0000 (03:50 +0000)] 
Docs cleanup

Including hiding the constructors of classes which aren't supposed to be
initialised directly by the user.

4 years agoCOPY operations update cursor.rowcount
Daniele Varrazzo [Fri, 20 Nov 2020 02:47:44 +0000 (02:47 +0000)] 
COPY operations update cursor.rowcount

Copy.read() changed to return b"" on EOF, consistently with file.read().
Also changed copy generators to return the final result of the
operation, and pgconn.get_copy_data() to always return bytes as second
argument, because it will never return an empty string unless on error.

With this changeset all psycopg2 test_copy pass, both sync and async.

4 years agoAdded test to verify can't execute(copy)
Daniele Varrazzo [Fri, 20 Nov 2020 02:59:22 +0000 (02:59 +0000)] 
Added test to verify can't execute(copy)

4 years agoTypo in async with example fixed
Daniele Varrazzo [Thu, 19 Nov 2020 23:23:19 +0000 (23:23 +0000)] 
Typo in async with example fixed

4 years agoDocument async with connection and cursor
Daniele Varrazzo [Thu, 19 Nov 2020 19:29:57 +0000 (19:29 +0000)] 
Document async with connection and cursor

4 years agoDelay decisions about transaction operations to __enter__
Daniele Varrazzo [Thu, 19 Nov 2020 18:50:53 +0000 (18:50 +0000)] 
Delay decisions about transaction operations to __enter__

The transaction status of the connection may change concurrently between
__init__ and __enter__.

4 years agoFixed async copy example
Daniele Varrazzo [Thu, 19 Nov 2020 15:27:03 +0000 (15:27 +0000)] 
Fixed async copy example

4 years agoAdded rollback case to the transaction block example
Daniele Varrazzo [Thu, 19 Nov 2020 14:43:08 +0000 (14:43 +0000)] 
Added rollback case to the transaction block example

4 years agoMore docs about Rollback usage
Daniele Varrazzo [Thu, 19 Nov 2020 03:11:17 +0000 (03:11 +0000)] 
More docs about Rollback usage

4 years agoAvoid a cython call in bool loaders
Daniele Varrazzo [Thu, 19 Nov 2020 01:52:04 +0000 (01:52 +0000)] 
Avoid a cython call in bool loaders

It's probably inlined, but there is still the exception handler around.

4 years agoFixed overflow argument for float loader
Daniele Varrazzo [Thu, 19 Nov 2020 01:28:51 +0000 (01:28 +0000)] 
Fixed overflow argument for float loader

4 years agoAdded documentation for Rollback
Daniele Varrazzo [Thu, 19 Nov 2020 00:05:24 +0000 (00:05 +0000)] 
Added documentation for Rollback

4 years agoMerge branch 'nested-transactions'
Daniele Varrazzo [Wed, 18 Nov 2020 22:07:22 +0000 (22:07 +0000)] 
Merge branch 'nested-transactions'

4 years agoMore efficient float loading
Daniele Varrazzo [Wed, 18 Nov 2020 21:56:53 +0000 (21:56 +0000)] 
More efficient float loading

4 years agoUse "private" savepoint name to avoid conflicting with user ones
Daniele Varrazzo [Wed, 18 Nov 2020 15:21:34 +0000 (15:21 +0000)] 
Use "private" savepoint name to avoid conflicting with user ones

"s1" is too common.

Also omit ``savepoint`` in sql statements: it is a noise word

4 years agoAdded documentation for transaction management
Daniele Varrazzo [Wed, 18 Nov 2020 15:05:35 +0000 (15:05 +0000)] 
Added documentation for transaction management

4 years agoMap errors 08* to OperationalError
Daniele Varrazzo [Tue, 17 Nov 2020 15:14:52 +0000 (15:14 +0000)] 
Map errors 08* to OperationalError

See https://github.com/psycopg/psycopg2/pull/1148

4 years agoTransaction tests cleanup
Daniele Varrazzo [Mon, 16 Nov 2020 16:26:38 +0000 (16:26 +0000)] 
Transaction tests cleanup

4 years agoFixed transaction behaviour when there is a transaction already started
Daniele Varrazzo [Mon, 16 Nov 2020 16:26:38 +0000 (16:26 +0000)] 
Fixed transaction behaviour when there is a transaction already started

State management simplified too.

4 years agoCommands to enter/exit a transaction with named savepoint tweaked
Daniele Varrazzo [Mon, 16 Nov 2020 13:56:44 +0000 (13:56 +0000)] 
Commands to enter/exit a transaction with named savepoint tweaked

- Batch together begin + savepoint
- Do without releasing the savepoint immediately before commit/rollback

4 years agoCommands generation separated from execution in transactions
Daniele Varrazzo [Mon, 16 Nov 2020 03:52:29 +0000 (03:52 +0000)] 
Commands generation separated from execution in transactions

Commands and state change are independent from sync/async. Only the
execution and the interface is in the different sync/async subclasses
now.

4 years agoDefine at init rather than at enter if the transaction is top-level
Daniele Varrazzo [Mon, 16 Nov 2020 03:38:26 +0000 (03:38 +0000)] 
Define at init rather than at enter if the transaction is top-level

4 years agoRefactoring to minimize sync/async savepoint duplications
Daniele Varrazzo [Mon, 16 Nov 2020 03:31:29 +0000 (03:31 +0000)] 
Refactoring to minimize sync/async savepoint duplications

4 years agoAdded AsyncConnection.transaction()
Daniele Varrazzo [Sun, 15 Nov 2020 21:23:43 +0000 (21:23 +0000)] 
Added AsyncConnection.transaction()

4 years agoAnonymous savepoints represented by empty string
Daniele Varrazzo [Sun, 15 Nov 2020 20:40:34 +0000 (20:40 +0000)] 
Anonymous savepoints represented by empty string

It makes signatures and types easier. Empty string is not valid anyway,
and bonkers types are not checked.

4 years agoConnection.transaction is a context manager
Daniele Varrazzo [Sun, 15 Nov 2020 20:30:03 +0000 (20:30 +0000)] 
Connection.transaction is a context manager

It will help to avoid an async with (await conn.transaction()) on async
connections.

4 years agoDropped now redundant copy test
Daniele Varrazzo [Sun, 15 Nov 2020 13:17:31 +0000 (13:17 +0000)] 
Dropped now redundant copy test

4 years agoAdded asynccontextmanager for Python 3.6
Daniele Varrazzo [Sun, 15 Nov 2020 04:00:27 +0000 (04:00 +0000)] 
Added asynccontextmanager for Python 3.6

4 years agoBinary copy tests enabled: now there is an int binary dumper
Daniele Varrazzo [Sun, 15 Nov 2020 02:32:11 +0000 (02:32 +0000)] 
Binary copy tests enabled: now there is an int binary dumper

4 years agoCopy object interface simplified
Daniele Varrazzo [Sun, 15 Nov 2020 01:57:14 +0000 (01:57 +0000)] 
Copy object interface simplified

Dropped methods and code paths no more useful now that the user can only
interact with Copy as a context.

4 years agoCursor.copy() made into a context manager
Daniele Varrazzo [Sun, 15 Nov 2020 01:47:51 +0000 (01:47 +0000)] 
Cursor.copy() made into a context manager

What was before was a factory function, however that forced to have a
pattern like:

    async with (await cursor.copy()) as copy

Now instead what should be used is:

    async with cursor.copy() as copy

With this change the user pretty much is never exposed anymore to a Copy
object in a non-entered state. This is actually useful because it
reduces the surface of the API: now for instance Copy.finis() can become
a private method.

4 years agoDropped now redundant copy test
Daniele Varrazzo [Sun, 15 Nov 2020 13:17:31 +0000 (13:17 +0000)] 
Dropped now redundant copy test

4 years agoAdded asynccontextmanager for Python 3.6
Daniele Varrazzo [Sun, 15 Nov 2020 04:00:27 +0000 (04:00 +0000)] 
Added asynccontextmanager for Python 3.6

4 years agoBinary copy tests enabled: now there is an int binary dumper
Daniele Varrazzo [Sun, 15 Nov 2020 02:32:11 +0000 (02:32 +0000)] 
Binary copy tests enabled: now there is an int binary dumper

4 years agoCopy object interface simplified
Daniele Varrazzo [Sun, 15 Nov 2020 01:57:14 +0000 (01:57 +0000)] 
Copy object interface simplified

Dropped methods and code paths no more useful now that the user can only
interact with Copy as a context.

4 years agoCursor.copy() made into a context manager
Daniele Varrazzo [Sun, 15 Nov 2020 01:47:51 +0000 (01:47 +0000)] 
Cursor.copy() made into a context manager

What was before was a factory function, however that forced to have a
pattern like:

    async with (await cursor.copy()) as copy

Now instead what should be used is:

    async with cursor.copy() as copy

With this change the user pretty much is never exposed anymore to a Copy
object in a non-entered state. This is actually useful because it
reduces the surface of the API: now for instance Copy.finis() can become
a private method.

4 years agoEscape savepoint names
Daniele Varrazzo [Sat, 14 Nov 2020 23:03:39 +0000 (23:03 +0000)] 
Escape savepoint names

Added more internal support to the connection to generate internal
commands dynamically, thanks to the `sql` module now implemented.

4 years agoTransaction fixed after rebase on master
Daniele Varrazzo [Sat, 14 Nov 2020 22:22:47 +0000 (22:22 +0000)] 
Transaction fixed after rebase on master

4 years agoFirst-cut implementation of connection.transaction()
Daniel Fortunov [Sat, 25 Jul 2020 11:27:31 +0000 (12:27 +0100)] 
First-cut implementation of connection.transaction()

4 years agoDocument COPY differences and async use
Daniele Varrazzo [Sat, 14 Nov 2020 19:20:38 +0000 (19:20 +0000)] 
Document COPY differences and async use

4 years agoWork around Py2 api of PyFloat_FromDouble in Cython
Daniele Varrazzo [Sat, 14 Nov 2020 18:01:29 +0000 (18:01 +0000)] 
Work around Py2 api of PyFloat_FromDouble in Cython

https://github.com/cython/cython/issues/3909

4 years agoBetter use of Python api for numeric load
Daniele Varrazzo [Sat, 14 Nov 2020 13:13:43 +0000 (13:13 +0000)] 
Better use of Python api for numeric load

Float remains to be tweaked, as affected by
https://github.com/cython/cython/issues/3909

4 years agoAdded C float and binary bool loaders
Daniele Varrazzo [Sat, 14 Nov 2020 03:26:00 +0000 (03:26 +0000)] 
Added C float and binary bool loaders

4 years agoSimpler bool loader implementation
Daniele Varrazzo [Sat, 14 Nov 2020 03:25:23 +0000 (03:25 +0000)] 
Simpler bool loader implementation

4 years agoTrying to dump int as int8, added binary dumpers for int and float
Daniele Varrazzo [Sat, 14 Nov 2020 02:24:43 +0000 (02:24 +0000)] 
Trying to dump int as int8, added binary dumpers for int and float

4 years agoGet oid numbers from builtins dict
Daniele Varrazzo [Sat, 14 Nov 2020 02:02:05 +0000 (02:02 +0000)] 
Get oid numbers from builtins dict

Now it's accessible after it was moved to the main package.

4 years agoReally update types on PostgresQuery.dump
Daniele Varrazzo [Fri, 13 Nov 2020 20:05:30 +0000 (20:05 +0000)] 
Really update types on PostgresQuery.dump

Let's do what it says on the tin, before micro-optimising.

4 years agoDocs build script path fixed
Daniele Varrazzo [Fri, 13 Nov 2020 13:36:45 +0000 (13:36 +0000)] 
Docs build script path fixed

4 years agoAdded more documentation on COPY
Daniele Varrazzo [Fri, 13 Nov 2020 03:09:06 +0000 (03:09 +0000)] 
Added more documentation on COPY

4 years agoDon't throw an error using COPY TO in a block
Daniele Varrazzo [Fri, 13 Nov 2020 00:49:04 +0000 (00:49 +0000)] 
Don't throw an error using COPY TO in a block

4 years agoCleanup of Copy attributes and parameters
Daniele Varrazzo [Thu, 12 Nov 2020 19:37:31 +0000 (19:37 +0000)] 
Cleanup of Copy attributes and parameters

4 years agoUsing generics to describe sync/async types
Daniele Varrazzo [Thu, 12 Nov 2020 19:09:42 +0000 (19:09 +0000)] 
Using generics to describe sync/async types

4 years agoFirst cut of cursor documentation
Daniele Varrazzo [Thu, 12 Nov 2020 15:25:49 +0000 (15:25 +0000)] 
First cut of cursor documentation

4 years agoVirtualenv to build the docs renamed to .vemv
Daniele Varrazzo [Thu, 12 Nov 2020 15:24:56 +0000 (15:24 +0000)] 
Virtualenv to build the docs renamed to .vemv

4 years agoTrigger docs build on push
Daniele Varrazzo [Thu, 12 Nov 2020 15:24:18 +0000 (15:24 +0000)] 
Trigger docs build on push

4 years agoImport, but don't expose, documented objects in the package.
Daniele Varrazzo [Thu, 12 Nov 2020 15:09:12 +0000 (15:09 +0000)] 
Import, but don't expose, documented objects in the package.

4 years agoAdded support to build docs unattended
Daniele Varrazzo [Thu, 12 Nov 2020 02:57:58 +0000 (02:57 +0000)] 
Added support to build docs unattended

4 years agoAdded failing tests to remember to implement connect_timeout
Daniele Varrazzo [Thu, 12 Nov 2020 02:13:03 +0000 (02:13 +0000)] 
Added failing tests to remember to implement connect_timeout

4 years agoMore Connection documentation.
Daniele Varrazzo [Thu, 12 Nov 2020 01:02:15 +0000 (01:02 +0000)] 
More Connection documentation.

4 years agoDropped Connection.status
Daniele Varrazzo [Thu, 12 Nov 2020 00:01:46 +0000 (00:01 +0000)] 
Dropped Connection.status

It is almost a synonym of closed. Will add an object to get all the info
from the connection.

4 years agoMore docs
Daniele Varrazzo [Wed, 11 Nov 2020 22:54:59 +0000 (22:54 +0000)] 
More docs