Commit Graph

13 Commits

Author SHA1 Message Date
Sebastian Rittau 2a0fc1b582 Annotate Error and Diagnostics (#7671)
Move cursor class to top of file so it can be used as base class
2022-04-21 21:19:34 -07:00
Alex Waygood b093c90a94 Use TypeAlias for type aliases where possible, part II (#7667) 2022-04-20 20:02:47 +01:00
Alex Waygood 740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Bao 79c654ef43 psycopg2: correct return type (#7607)
Fixes the return type of `psycopg2.cursor.fetchone()` to match the psycopg2 code:

https://github.com/psycopg/psycopg2/blob/1d3a89a0bba621dc1cc9b32db6d241bd2da85ad1/psycopg/cursor_type.c#L647-L651
https://github.com/psycopg/psycopg2/blob/1d3a89a0bba621dc1cc9b32db6d241bd2da85ad1/psycopg/cursor_type.c#L748-L786

It also matches the [psycopg2 documentation](https://www.psycopg.org/docs/cursor.html?highlight=copy_from#cursor.fetchone) as well as the [DB-API](https://peps.python.org/pep-0249/#fetchone)
2022-04-07 15:36:26 -07:00
Anders Kaseorg b78f0c21ba psycopg2: Accept Composable in place of query string (#7494)
https://www.psycopg.org/docs/sql.html#psycopg2.sql.Composable
“Composable objects can be passed directly to execute(),
executemany(), copy_expert() in place of the query string.”

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2022-03-15 20:47:30 -07:00
Sebastian Rittau 889164cb0c psycopg2: Annotate cursor execute* and dunder methods (#7460) 2022-03-08 08:13:19 -08:00
Alex Waygood 64af11c78f Correct several positional-only differences in third-party stubs (#7352) 2022-02-22 06:49:51 -08:00
Alex Waygood 8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Daniel Foerster 506be4fb0a Fix psycopg2 connection.cursor() stub (#6470)
Adds `scrollable=` argument missing since psycopg2 2.5 and prevents `Any` from being hinted when `cursor_factory=` is passed.
2021-12-02 17:50:25 +01:00
Joachim Jablon e96dde7618 psycopg2: use Error and Warning from _psycopg.pyi in errors.pyi (#6454) 2021-11-30 15:26:50 +02:00
Joachim Jablon 7e836db2f3 Move abstract methods to AbstractConnectionPool (#6340) 2021-11-23 09:40:45 +01:00
Sebastian Rittau 9f86972350 Add star to all non-0.1 versions (#6146) 2021-10-11 13:41:19 -07:00
Jukka Lehtosalo a0f199727b Stubs for psycopg2 (#5783) 2021-07-15 17:29:56 +02:00