]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
4 years agoBase TimeTz loader on regexp
Daniele Varrazzo [Sat, 15 May 2021 12:56:15 +0000 (14:56 +0200)] 
Base TimeTz loader on regexp

4 years agoFurther tweaks to date/time loaders
Daniele Varrazzo [Sat, 15 May 2021 12:55:56 +0000 (14:55 +0200)] 
Further tweaks to date/time loaders

4 years agoBase time loader on regexp
Daniele Varrazzo [Sat, 15 May 2021 11:23:26 +0000 (13:23 +0200)] 
Base time loader on regexp

Some 5x faster

4 years agoBase date and timestamp loaders on regexp instead of strptime
Daniele Varrazzo [Sat, 15 May 2021 10:47:58 +0000 (12:47 +0200)] 
Base date and timestamp loaders on regexp instead of strptime

Not only is 4x faster, but it's more straightforward to port to C
and keep similar algorithms (even if we decide to drop regexp in C)

4 years agoSeparate date/time tests in classes
Daniele Varrazzo [Sat, 15 May 2021 10:45:48 +0000 (12:45 +0200)] 
Separate date/time tests in classes

4 years agoFix datetime timezone adjustment on Python 3.6
Daniele Varrazzo [Fri, 14 May 2021 18:04:23 +0000 (20:04 +0200)] 
Fix datetime timezone adjustment on Python 3.6

4 years agoAdd test for timestamptz timezone load behaviour
Daniele Varrazzo [Fri, 14 May 2021 17:42:29 +0000 (19:42 +0200)] 
Add test for timestamptz timezone load behaviour

4 years agoAdd docs and tests for ConnectionInfo.timezone
Daniele Varrazzo [Fri, 14 May 2021 17:26:37 +0000 (19:26 +0200)] 
Add docs and tests for ConnectionInfo.timezone

4 years agoMove timezone attribute to the Connection.info interface
Daniele Varrazzo [Fri, 14 May 2021 16:37:24 +0000 (18:37 +0200)] 
Move timezone attribute to the Connection.info interface

Type changed to the abstract `datetime.tzinfo` so that we have the
option to return something else such as a `datetime.timezone` with fixed
offset.

Added function to retrieve the object internally from the PGconn.

4 years agoWarn only once about unknown zoneinfo
Daniele Varrazzo [Fri, 14 May 2021 16:19:32 +0000 (18:19 +0200)] 
Warn only once about unknown zoneinfo

4 years agoReturn timestamptz in the connection timezone
Daniele Varrazzo [Fri, 14 May 2021 15:50:06 +0000 (17:50 +0200)] 
Return timestamptz in the connection timezone

First cut, more tests to add. All current tests pass, except the
explicit checks for UTC tzinfo returned.

See https://github.com/psycopg/psycopg3/discussions/56

4 years agoMerge branch 'master' into binary-datetime
Daniele Varrazzo [Fri, 14 May 2021 15:07:03 +0000 (17:07 +0200)] 
Merge branch 'master' into binary-datetime

4 years agoMake the dependency on typing_extension optional
Daniele Varrazzo [Fri, 14 May 2021 14:51:17 +0000 (16:51 +0200)] 
Make the dependency on typing_extension optional

4 years agoReturn timestamptz as utc datetime loading in text format
Daniele Varrazzo [Thu, 13 May 2021 21:04:19 +0000 (23:04 +0200)] 
Return timestamptz as utc datetime loading in text format

This makes text and binary loaders return the same value. It also fixes
the problem of the missing seconds in the timezone offset on Python 3.6.

The opposite choice, returning datetime in the connection timezone on
binary loading, doesn't seem really feasible: pytz cannot parse all the
Postgres timezone values (for instance, "+02:00" can't be parsed): take
a look at
https://www.postgresql.org/docs/13/datetime-posix-timezone-specs.html to
understand how much of a bad idea it would be.

4 years agoFix timestamptz binary tests with seconds in the timezone on Python 3.6
Daniele Varrazzo [Thu, 13 May 2021 16:41:04 +0000 (18:41 +0200)] 
Fix timestamptz binary tests with seconds in the timezone on Python 3.6

4 years agoConsider loss of precision in negative binary timestamps too
Daniele Varrazzo [Thu, 13 May 2021 09:49:33 +0000 (11:49 +0200)] 
Consider loss of precision in negative binary timestamps too

4 years agoAdd timedelta/interval binary adapter
Daniele Varrazzo [Thu, 13 May 2021 02:10:31 +0000 (04:10 +0200)] 
Add timedelta/interval binary adapter

4 years agoAdd timestamptz adapter
Daniele Varrazzo [Thu, 13 May 2021 01:19:11 +0000 (03:19 +0200)] 
Add timestamptz adapter

4 years agoForce text query in tests playing with datestyle
Daniele Varrazzo [Wed, 12 May 2021 23:17:50 +0000 (01:17 +0200)] 
Force text query in tests playing with datestyle

Just in case in the future we switch to binary return values and we stop
testing anything.

4 years agoAdd datetime binary adapter
Daniele Varrazzo [Wed, 12 May 2021 23:13:20 +0000 (01:13 +0200)] 
Add datetime binary adapter

Only for naive datetimes, timezone not handled yet.

4 years agoAdd timetz binary adapters
Daniele Varrazzo [Wed, 12 May 2021 20:44:26 +0000 (22:44 +0200)] 
Add timetz binary adapters

4 years agoAdd time binary adapters
Daniele Varrazzo [Wed, 12 May 2021 19:38:58 +0000 (21:38 +0200)] 
Add time binary adapters

No timezone yet, some tests fail.

4 years agoAdd date binary adapters
Daniele Varrazzo [Wed, 12 May 2021 18:55:40 +0000 (20:55 +0200)] 
Add date binary adapters

4 years agoDrop unused import
Daniele Varrazzo [Wed, 12 May 2021 16:44:22 +0000 (18:44 +0200)] 
Drop unused import

4 years agoMerge branch 'binary-numeric'
Daniele Varrazzo [Mon, 10 May 2021 08:39:19 +0000 (10:39 +0200)] 
Merge branch 'binary-numeric'

4 years agoImprove wording of docker testing notes
Daniele Varrazzo [Mon, 10 May 2021 08:26:00 +0000 (10:26 +0200)] 
Improve wording of docker testing notes

4 years agoAdd example about running tests in docker
Daniele Varrazzo [Sun, 9 May 2021 23:46:30 +0000 (01:46 +0200)] 
Add example about running tests in docker

Writing it down as I have to hack it together every time.

4 years agoFix dumping Decimal of the form 0E+n
Daniele Varrazzo [Sun, 9 May 2021 23:22:12 +0000 (01:22 +0200)] 
Fix dumping Decimal of the form 0E+n

4 years agoFix test for ConnectionInfo.hostaddr and libpq < 12
Daniele Varrazzo [Wed, 5 May 2021 16:32:06 +0000 (18:32 +0200)] 
Fix test for ConnectionInfo.hostaddr and libpq < 12

4 years agoAdd script to test the pool performance
Daniele Varrazzo [Sun, 9 May 2021 23:04:37 +0000 (01:04 +0200)] 
Add script to test the pool performance

4 years agoAdd benchmark test for binary numeric
Daniele Varrazzo [Sun, 9 May 2021 22:52:16 +0000 (00:52 +0200)] 
Add benchmark test for binary numeric

Conclusion is that for the moment it is better to leave default Decimal
dump to text format. Better performance can be obtained accessing the
Python C Decimal structure and perform conversion from there.

4 years agoUse faster C mod operator in Decimal dump
Daniele Varrazzo [Sun, 9 May 2021 21:17:59 +0000 (23:17 +0200)] 
Use faster C mod operator in Decimal dump

4 years agoAdd C implementation of Decimal dumper
Daniele Varrazzo [Sun, 9 May 2021 18:37:51 +0000 (20:37 +0200)] 
Add C implementation of Decimal dumper

4 years agoDon't dump an excess of right 0's in Decimal to numeric
Daniele Varrazzo [Sat, 8 May 2021 17:13:21 +0000 (19:13 +0200)] 
Don't dump an excess of right 0's in Decimal to numeric

4 years agoAdd Cython implementation of NumericBinaryLoader
Daniele Varrazzo [Thu, 6 May 2021 19:22:39 +0000 (21:22 +0200)] 
Add Cython implementation of NumericBinaryLoader

4 years agoAdd C implementation of text decimal adapters
Daniele Varrazzo [Thu, 6 May 2021 17:58:14 +0000 (19:58 +0200)] 
Add C implementation of text decimal adapters

4 years agoAdd dumper for Python int to numeric
Daniele Varrazzo [Thu, 6 May 2021 17:08:20 +0000 (19:08 +0200)] 
Add dumper for Python int to numeric

4 years agoHandle Decimal sNaN value
Daniele Varrazzo [Thu, 6 May 2021 02:26:06 +0000 (04:26 +0200)] 
Handle Decimal sNaN value

4 years agoDump numeric as binary without manipulating the digits tuple
Daniele Varrazzo [Thu, 6 May 2021 01:42:37 +0000 (03:42 +0200)] 
Dump numeric as binary without manipulating the digits tuple

Will make for a much faster algorithm in C

4 years agoDecimal binary dump algorithm streamlined
Daniele Varrazzo [Wed, 5 May 2021 18:20:52 +0000 (20:20 +0200)] 
Decimal binary dump algorithm streamlined

4 years agoAdd Decimal values to random tests
Daniele Varrazzo [Wed, 5 May 2021 17:47:14 +0000 (19:47 +0200)] 
Add Decimal values to random tests

4 years agoAdd prototype for a decimal binary dumper
Daniele Varrazzo [Wed, 5 May 2021 17:15:02 +0000 (19:15 +0200)] 
Add prototype for a decimal binary dumper

The algorithm is pretty unwieldy, maybe it can be refactored. But tests
show that it should be correct.

4 years agoUpgrade testing libraries (#50)
Denis Laxalde [Wed, 5 May 2021 15:02:58 +0000 (17:02 +0200)] 
Upgrade testing libraries (#50)

Use latest versions of testing libraries

pytest is broken on Python 3.10, until version 6.2.4.

4 years agoAdd numeric binary loader
Daniele Varrazzo [Tue, 4 May 2021 21:08:45 +0000 (23:08 +0200)] 
Add numeric binary loader

4 years agoAdd pytest marker to skip tests on certain server versions
Daniele Varrazzo [Tue, 4 May 2021 16:08:30 +0000 (18:08 +0200)] 
Add pytest marker to skip tests on certain server versions

4 years agoFix typo in doc title
Daniele Varrazzo [Sun, 2 May 2021 09:48:53 +0000 (11:48 +0200)] 
Fix typo in doc title

4 years agoCheck documentation build in CI
Denis Laxalde [Tue, 27 Apr 2021 07:49:30 +0000 (09:49 +0200)] 
Check documentation build in CI

4 years agoAdd regression test for the infinity date example
Daniele Varrazzo [Sun, 2 May 2021 00:23:16 +0000 (02:23 +0200)] 
Add regression test for the infinity date example

4 years agoAdd an adaptation example for infinity date
Denis Laxalde [Thu, 29 Apr 2021 09:14:32 +0000 (11:14 +0200)] 
Add an adaptation example for infinity date

Take from https://www.psycopg.org/articles/2020/11/24/psycopg3-adaptation/

4 years agoBypass call to _get_optimised if using the Python implementation
Daniele Varrazzo [Sun, 2 May 2021 00:10:41 +0000 (02:10 +0200)] 
Bypass call to _get_optimised if using the Python implementation

4 years agoDumpers ownership dict micro-optimisation
Daniele Varrazzo [Sat, 1 May 2021 23:59:55 +0000 (01:59 +0200)] 
Dumpers ownership dict micro-optimisation

Copying is ~10x faster than creating a new dict.

4 years agoFixed adapters copy-on-write
Daniele Varrazzo [Sat, 1 May 2021 23:47:23 +0000 (01:47 +0200)] 
Fixed adapters copy-on-write

If a wider context is customised don't affect smaller contexts already
created.

4 years agoUse an explicit dumper map for the auto format.
Daniele Varrazzo [Sat, 1 May 2021 23:26:35 +0000 (01:26 +0200)] 
Use an explicit dumper map for the auto format.

The dumper chosen in auto format is the last one registered, if both the
text and binary ones are available. For all the builtin types the
preferred format is binary, except for strings and for json.

Dumping strings as text by default was handled by a special case; now
they are just handled by registering the text dumper after the binary
one. Json is now text by default, because it's marginally more
efficient.

4 years agoFix a typo in adaptation documentation
Denis Laxalde [Thu, 29 Apr 2021 09:25:17 +0000 (11:25 +0200)] 
Fix a typo in adaptation documentation

4 years agoMerge branch 'type-row'
Daniele Varrazzo [Fri, 30 Apr 2021 15:55:41 +0000 (17:55 +0200)] 
Merge branch 'type-row'

4 years agoFurther negotiation for good row types docs 47/head
Daniele Varrazzo [Fri, 30 Apr 2021 14:42:09 +0000 (16:42 +0200)] 
Further negotiation for good row types docs

Improvements can be made, however I would rather merge this branch to
master and improve the whole docs.

4 years agoProofread row factories doc
Denis Laxalde [Fri, 30 Apr 2021 13:26:21 +0000 (15:26 +0200)] 
Proofread row factories doc

4 years agoImprove row factory docs
Daniele Varrazzo [Fri, 30 Apr 2021 12:44:29 +0000 (14:44 +0200)] 
Improve row factory docs

Describe the protocol objects too. Expose them in the `psycopg3.rows`
module.

4 years agoAdd typing docs and example for psycopg3.rows
Daniele Varrazzo [Fri, 30 Apr 2021 10:43:29 +0000 (12:43 +0200)] 
Add typing docs and example for psycopg3.rows

4 years agoDrop RowConn from proto
Daniele Varrazzo [Fri, 30 Apr 2021 00:36:33 +0000 (02:36 +0200)] 
Drop RowConn from proto

Use a more local CursorRow definition.

4 years agoDefine an AnyCursor type alias
Denis Laxalde [Wed, 28 Apr 2021 12:58:19 +0000 (14:58 +0200)] 
Define an AnyCursor type alias

This will make it easier to define custom row factories without having
to use BaseCursor[Any, <rowtype>] as the connection type is not
meaningful in this context.

We expose this name instead of BaseCursor in top-level package
accordingly.

4 years agoBump up tests timeout on github action
Daniele Varrazzo [Thu, 29 Apr 2021 17:48:44 +0000 (19:48 +0200)] 
Bump up tests timeout on github action

4 years agoAdd typing test for cursor iteration
Daniele Varrazzo [Thu, 29 Apr 2021 17:22:27 +0000 (19:22 +0200)] 
Add typing test for cursor iteration

4 years agoFix typing of server-side cursors fetchmany/fetchall
Daniele Varrazzo [Thu, 29 Apr 2021 17:06:35 +0000 (19:06 +0200)] 
Fix typing of server-side cursors fetchmany/fetchall

4 years agoFix `Connection.connect()` return type
Daniele Varrazzo [Thu, 29 Apr 2021 16:11:14 +0000 (18:11 +0200)] 
Fix `Connection.connect()` return type

Now `connect()` returns a `Connection[Tuple]`, whereas
`connect(row_factory=something)` return the type of what row factory
produces. The implementation of this is somewhat brittle, but that's
mypy for you: @dlax (thank you!) noticed that defining `**kwargs:
Union[str, int]` helped to disambiguate the row_factory param. I guess
we will make a best-effort to maintain this "interface". Everything is
to be documented.

Strangely, mypy cannot figure out the type of

    conn = await self.connection_class.connect(
        self.conninfo, **self.kwargs
    )

in the async pool, but it can for the sync one (without the `await`).
Added explicit type to disambiguate, on both the classes, for symmetry.

Added regression tests to verify that refactoring doesn't break type
inference.

4 years agoIllustrate type annotations in row factories documentation
Denis Laxalde [Tue, 27 Apr 2021 12:07:36 +0000 (14:07 +0200)] 
Illustrate type annotations in row factories documentation

4 years agoCheck test_typing with mypy as part of the pytest run
Daniele Varrazzo [Mon, 26 Apr 2021 17:43:38 +0000 (18:43 +0100)] 
Check test_typing with mypy as part of the pytest run

4 years agoMake Connection generic on Row
Denis Laxalde [Tue, 20 Apr 2021 08:30:03 +0000 (10:30 +0200)] 
Make Connection generic on Row

We use a type variable 'RowConn' for Connection that is distinct from
'Row' that is used on Cursor side in order to reflect the possibility to
have distinct row factories on connection and cursor sides.

In order to avoid "propagation" of the Row type variable of Connection
classes, we use Any everywhere that variable is not used (namely,
everywhere outside the connection module).

The typing_example.py almost works: connect(row_factory=...) returns a
typed Connection, but only connect() still returns a Connection[Any].

4 years agoDefine Connection's row_factory as a property
Denis Laxalde [Fri, 23 Apr 2021 13:41:41 +0000 (15:41 +0200)] 
Define Connection's row_factory as a property

This is similar to Cursor class and will make things easier in following
changes, making Connection generic on row type.

4 years agoAvoid repeating the default row_factory in Connection methods
Denis Laxalde [Wed, 21 Apr 2021 07:59:39 +0000 (09:59 +0200)] 
Avoid repeating the default row_factory in Connection methods

We set the default row_factory argument value to None in connect()
methods and use row_factory class attribute when unspecified, thus
avoiding repetition of the 'tuple_row' value.

4 years agoAdd a typing example (mypy) test
Denis Laxalde [Wed, 7 Apr 2021 14:57:20 +0000 (16:57 +0200)] 
Add a typing example (mypy) test

This example is checked by running mypy on it with both Python and C
implementation.

By having cursor and record values' type declared before assignment, we
make sure that expected types are consistent (otherwise mypy would raise
"Incompatible types in assignment" errors).

Example check_row_factory_connection() is still incomplete because
Connection is not generic on Row; it thus contain many Any types.

4 years agoChange directory in tox's 'tests' environments
Denis Laxalde [Mon, 19 Apr 2021 13:28:03 +0000 (15:28 +0200)] 
Change directory in tox's 'tests' environments

This avoids path manipulation and would help with the next commit (where
current directory will matter).

4 years agoMake Cursor generic on Row
Denis Laxalde [Thu, 15 Apr 2021 15:49:04 +0000 (17:49 +0200)] 
Make Cursor generic on Row

We make RowMaker, RowFactory and Cursor types generic on a Row type
variable thus making type inference work on cursor's fetch*() methods.

For example:

    R = TypeVar("R")
    def my_row_factory(cursor: BaseCursor[Any, R]) -> Callable[[Sequence[Any]], R]:
        ...

    with conn.cursor(row_factory=my_row_factory) as cur:
        cur.execute("select 1")
        reveal_type(cur)
        # Revealed type is 'psycopg3.cursor.Cursor[R`-1]'
        r = cur.fetchone()
        reveal_type(r)
        # Revealed type is 'Union[R`-1, None]'

The definition of RowMaker and RowFactory protocols needs two distinct
type variable because the former is covariant on Row (using 'Row_co'
type variable) and the latter is invariant on Row.

In Cursor.__init__(), row_factory argument is now required as we remove
its default value 'tuple_row'; this is helpful in order to keep Cursor
definition generic on Row, which would be more difficult when specifying
a concrete RowFactory by default binding Row to Tuple.

The Connection is not (yet) generic on Row, so we use RowFactory[Any].
Still, in cursor() methods, we get a fully typed Cursor value when a
row_factory argument is passed. We add two overloaded variants of these
cursor() methods depending on whether row_factory is passed or not (in
the former case, we return a Cursor[Row], in the latter case, a
Cursor[Any]).

A noticeable improvement is that we no longer need to explicitly declare
or ignore types in Transformer's load_row() and load_rows() as this is
not correctly inferred. Similarly, type annotations are not needed
anymore in callers of these methods (Cursor's fetch*() methods).
In TypeInfo's fetch*() method, we can drop superfluous type annotations.

4 years agoMove 'make_row' attribute from Transformer to Cursor
Denis Laxalde [Wed, 14 Apr 2021 14:02:53 +0000 (16:02 +0200)] 
Move 'make_row' attribute from Transformer to Cursor

Having this attribute defined in Transformer protocol will be
problematic when making the RowMaker protocol generic on Row because
we'll then have to also make Transformer generic on Row and
"propagating" the type variable will produce a lot of churn in the code
base.

Also, the variance (covariant) of Row in RowMaker will conflict with that
in Transformer (invariant).

On the other hand, keeping the RowMaker value and its underlying
RowFactory together/attached to the same object (now Cursor) seems
safer for consistency.

4 years agoRemove constraints on Row TypeVar
Denis Laxalde [Thu, 25 Feb 2021 07:24:29 +0000 (08:24 +0100)] 
Remove constraints on Row TypeVar

It's not clear why there is both Tuple[Any, ...] and Any as possible
types for Row and since Any is one possibility it seems that anything is
possible so those constraints appear to be useless.

We can now remove a few '# type: ignore[no-any-return]' in
*Cursor.fetchone(). On the other hand, mypy wants us to declare the type
of 'records' values coming from transformer's load_rows():

    error: Need type annotation for 'records' (hint: "records: List[<type>] = ...")  [var-annotated]

4 years agoAdjust return type of ServerCursorHelper._fetch_gen()
Denis Laxalde [Mon, 12 Apr 2021 12:08:35 +0000 (14:08 +0200)] 
Adjust return type of ServerCursorHelper._fetch_gen()

This method returns cur._tx.load_rows() which return type is List[Row].

We now need 'type: ignore[no-any-return]' in fetchone() methods or
server cursor classes, similarly as in client cursor classes.

4 years agoSeparate C and Python pgresult_ptr attribute names
Daniele Varrazzo [Fri, 23 Apr 2021 00:46:40 +0000 (01:46 +0100)] 
Separate C and Python pgresult_ptr attribute names

The distinction is not used yet. However, let's do that for consistency
with pgconn_ptr.

4 years agoSeparate C and Python pgconn_ptr attribute names
Daniele Varrazzo [Fri, 23 Apr 2021 00:42:54 +0000 (01:42 +0100)] 
Separate C and Python pgconn_ptr attribute names

Now that we are tapping into ctypes to access to the libpq dynamically
the Python value is handy for the cython layer too (see PGconn.hostaddr
implementation).

4 years agoMerge branch 'conn-info'
Daniele Varrazzo [Fri, 23 Apr 2021 00:35:34 +0000 (01:35 +0100)] 
Merge branch 'conn-info'

4 years agoAllow reading needs_password, used_password on broken connections
Daniele Varrazzo [Fri, 23 Apr 2021 00:30:19 +0000 (01:30 +0100)] 
Allow reading needs_password, used_password on broken connections

It makes sense (especially the former: it is used to detect if a
password was needed). However they are not that easy to use because a
failed connection attempt will throw an exception. For this reason they
are not added to ConnectionInfo.

4 years agoAdd ConnectionInfo.error_message, backend_pid
Daniele Varrazzo [Fri, 23 Apr 2021 00:29:53 +0000 (01:29 +0100)] 
Add ConnectionInfo.error_message, backend_pid

4 years agoFurther ConnectionInfo docs improvements
Daniele Varrazzo [Thu, 22 Apr 2021 23:51:18 +0000 (00:51 +0100)] 
Further ConnectionInfo docs improvements

4 years agoMore compact doc rendering of introspected property types
Daniele Varrazzo [Thu, 22 Apr 2021 19:18:32 +0000 (20:18 +0100)] 
More compact doc rendering of introspected property types

4 years agoEnsure pgconn_ptr, pgresult_ptr to return int in every implementation
Daniele Varrazzo [Thu, 22 Apr 2021 13:44:28 +0000 (14:44 +0100)] 
Ensure pgconn_ptr, pgresult_ptr to return int in every implementation

4 years agoAdd ConnInfo.hostaddr
Daniele Varrazzo [Thu, 22 Apr 2021 12:28:53 +0000 (13:28 +0100)] 
Add ConnInfo.hostaddr

Also add C implementation of PGconn.hostaddr.

4 years agoAdd ConnectionInfo.server_version, protocol_version
Daniele Varrazzo [Fri, 16 Apr 2021 18:17:03 +0000 (19:17 +0100)] 
Add ConnectionInfo.server_version, protocol_version

4 years agoAdd ConnectionInfo docs
Daniele Varrazzo [Mon, 12 Apr 2021 17:30:40 +0000 (18:30 +0100)] 
Add ConnectionInfo docs

4 years agoAdd ConnectionInfo.parameter_status
Daniele Varrazzo [Mon, 12 Apr 2021 16:16:22 +0000 (17:16 +0100)] 
Add ConnectionInfo.parameter_status

4 years agoDrop use of PQerror in ConnectionInfo
Daniele Varrazzo [Mon, 12 Apr 2021 15:59:57 +0000 (16:59 +0100)] 
Drop use of PQerror in ConnectionInfo

4 years agoTest password not included in ConnectionInfo.get_parameters()
Daniele Varrazzo [Mon, 28 Dec 2020 03:38:51 +0000 (04:38 +0100)] 
Test password not included in ConnectionInfo.get_parameters()

4 years agoAdded some flesh to the connection.info object
Daniele Varrazzo [Mon, 28 Dec 2020 03:25:08 +0000 (04:25 +0100)] 
Added some flesh to the connection.info object

4 years agoOnly change logging level if not set
Daniele Varrazzo [Wed, 21 Apr 2021 09:56:38 +0000 (10:56 +0100)] 
Only change logging level if not set

See #43

4 years agoUse automatic type hints in docs
Daniele Varrazzo [Fri, 16 Apr 2021 18:01:02 +0000 (19:01 +0100)] 
Use automatic type hints in docs

The result is not perfect but it can be improved. Better than redefining
all the types.

4 years agoFix missing dsn in async pool tests too
Daniele Varrazzo [Fri, 16 Apr 2021 11:37:42 +0000 (12:37 +0100)] 
Fix missing dsn in async pool tests too

4 years agoPass 'dsn' value to ConnectionPool in tests
Denis Laxalde [Thu, 15 Apr 2021 14:19:10 +0000 (16:19 +0200)] 
Pass 'dsn' value to ConnectionPool in tests

Otherwise, those tests fail when there's no database named after current
user (typically, 'connection failed: database "denis" does not exist').

4 years agoAlias Task to asyncio.Future for python version < 3.8
Denis Laxalde [Tue, 13 Apr 2021 08:06:32 +0000 (10:06 +0200)] 
Alias Task to asyncio.Future for python version < 3.8

This resolves the following mypy error on Python 3.7:

  psycopg3/psycopg3/pool/async_pool.py:72: error: Argument 1 to "append" of "list" has incompatible type "Future[None]"; expected "Task[None]" [arg-type]

4 years agoFix test run with no --loop selected
Daniele Varrazzo [Mon, 12 Apr 2021 15:50:54 +0000 (16:50 +0100)] 
Fix test run with no --loop selected

4 years agoTest psycopg3 with uvloop
Daniele Varrazzo [Mon, 12 Apr 2021 15:35:43 +0000 (16:35 +0100)] 
Test psycopg3 with uvloop

It works, it seems.

4 years agoAdd tests readme
Daniele Varrazzo [Mon, 12 Apr 2021 15:18:01 +0000 (16:18 +0100)] 
Add tests readme

4 years agoMerge branch 'quiet-logger'
Daniele Varrazzo [Mon, 12 Apr 2021 15:17:48 +0000 (16:17 +0100)] 
Merge branch 'quiet-logger'