]>
git.ipfire.org Git - thirdparty/psycopg.git/log
Daniele Varrazzo [Thu, 17 Dec 2020 12:55:56 +0000 (13:55 +0100)]
Reduce re-allocations in objects quoting
Daniele Varrazzo [Thu, 17 Dec 2020 11:50:48 +0000 (12:50 +0100)]
Fixed broken previous commit
Daniele Varrazzo [Thu, 17 Dec 2020 04:55:56 +0000 (05:55 +0100)]
escape_string, escape_identifier use buffers too
Daniele Varrazzo [Thu, 17 Dec 2020 04:13:25 +0000 (05:13 +0100)]
Make wider use of Composite.as_bytes
Daniele Varrazzo [Thu, 17 Dec 2020 04:02:35 +0000 (05:02 +0100)]
Added buffer object to wrap libpq memory
Several code paths extended to deal with objects implementing the buffer
protocol instead of just bytes: this allows to perform less memory copy.
Added sql.Composable.as_bytes method to use in preference of as_string
(you may do without decoding altogether).
Daniele Varrazzo [Thu, 17 Dec 2020 01:29:09 +0000 (02:29 +0100)]
Added bytearray and memoryview dumpers
Also manage these objects when they rich the libp param passing.
Daniele Varrazzo [Wed, 16 Dec 2020 21:06:17 +0000 (22:06 +0100)]
Dropped use of a couple of constants in json
Daniele Varrazzo [Wed, 16 Dec 2020 21:05:02 +0000 (22:05 +0100)]
Added docs about string/binary adaptation
Daniele Varrazzo [Thu, 10 Dec 2020 12:41:59 +0000 (13:41 +0100)]
Sponsorship by @commandprompt - Thank you very much @jdatcmd
Daniele Varrazzo [Thu, 10 Dec 2020 12:19:22 +0000 (13:19 +0100)]
Added @mailupinc sponsor. Thank you!
Daniele Varrazzo [Thu, 10 Dec 2020 12:08:19 +0000 (13:08 +0100)]
Sponsorship by @phenopolis from @pontikos
Thank you very much, Niko!
Daniele Varrazzo [Thu, 10 Dec 2020 12:01:17 +0000 (13:01 +0100)]
Updated sponsorship by @gporcari @genropy
Grazie tantissime, Giovanni!
Daniele Varrazzo [Thu, 10 Dec 2020 11:04:46 +0000 (12:04 +0100)]
Backers file converted to yaml
It will be displayed at https://www.psycopg.org/sponsors/
Daniele Varrazzo [Thu, 10 Dec 2020 02:51:36 +0000 (03:51 +0100)]
Added several range tests and fixed a pasto error
Daniele Varrazzo [Thu, 10 Dec 2020 01:43:55 +0000 (02:43 +0100)]
Merge branch 'range-adaptation'
Daniele Varrazzo [Sun, 6 Dec 2020 02:50:50 +0000 (02:50 +0000)]
Added range type fetching and registration
Fixed quoting of [ ] chars for range types: unlike for composite they
need quoting.
Daniele Varrazzo [Sun, 6 Dec 2020 01:35:16 +0000 (01:35 +0000)]
Fetch/register composite made methods of a CompositeInfo class.
Daniele Varrazzo [Sat, 5 Dec 2020 18:41:26 +0000 (18:41 +0000)]
Added builtin ranges adaptation
Daniele Varrazzo [Tue, 8 Dec 2020 08:55:41 +0000 (09:55 +0100)]
Added `conection.execute()` method
Daniele Varrazzo [Sat, 5 Dec 2020 15:51:39 +0000 (15:51 +0000)]
Composite record parsing made independent from the "()" terminators
This should make this code useful to parse range representations too,
which may use a mix of () and [] terminators.
Daniele Varrazzo [Sat, 5 Dec 2020 14:38:39 +0000 (14:38 +0000)]
@Intevation is sponsoring psycopg3, thank you :)
Daniele Varrazzo [Sat, 5 Dec 2020 04:05:34 +0000 (04:05 +0000)]
Fixed escaping of a few chars in composite dumping
Daniele Varrazzo [Sat, 5 Dec 2020 02:48:40 +0000 (02:48 +0000)]
Fixed composite info fetch with homonymous types
Use a fully qualified name, optionally expressed as sql.Identifier, to
find the type in the right schema.
Daniele Varrazzo [Sat, 5 Dec 2020 01:58:19 +0000 (01:58 +0000)]
Installation and readme improvements
Daniele Varrazzo [Sat, 5 Dec 2020 00:52:05 +0000 (00:52 +0000)]
Dropped erroneous statement that psycopg3 quotes values
Daniele Varrazzo [Sat, 5 Dec 2020 00:28:18 +0000 (00:28 +0000)]
Added backer @bernhardreiter, thank you!
Daniele Varrazzo [Fri, 4 Dec 2020 04:48:02 +0000 (04:48 +0000)]
Small tweaks to add_backer script
Daniele Varrazzo [Fri, 4 Dec 2020 04:33:28 +0000 (04:33 +0000)]
Backers file updated
Added scripts to help maintaining it.
Daniele Varrazzo [Wed, 2 Dec 2020 19:03:15 +0000 (19:03 +0000)]
Fixed COPY statement suggesting it accepts parameters
It was, it just didn't work... :P
Daniele Varrazzo [Wed, 2 Dec 2020 17:26:26 +0000 (17:26 +0000)]
Fixed testing for diag properties on Pg < 9.6
Daniele Varrazzo [Wed, 2 Dec 2020 17:23:14 +0000 (17:23 +0000)]
Separate generators where the fd can change from the ones where not
This should make the query operation marginally faster.
Daniele Varrazzo [Wed, 2 Dec 2020 04:01:48 +0000 (04:01 +0000)]
Make sure Notify is hashable
Daniele Varrazzo [Wed, 2 Dec 2020 03:40:22 +0000 (03:40 +0000)]
Added a few tests from the psycopg2 test suite
Daniele Varrazzo [Wed, 2 Dec 2020 03:35:42 +0000 (03:35 +0000)]
Raise the correct error (diag and all) on commit error
Also added other error-related tests from psycopg2 test suite.
Daniele Varrazzo [Tue, 1 Dec 2020 14:29:00 +0000 (14:29 +0000)]
Fixed sdist package for psycopg3-c
`types` made into a package so that the setup.py is able to find the
Cython sources there.
Daniele Varrazzo [Tue, 1 Dec 2020 03:29:38 +0000 (03:29 +0000)]
Fixed links in error docs, uniform DB-API spelling
Daniele Varrazzo [Tue, 1 Dec 2020 03:19:02 +0000 (03:19 +0000)]
Dropped executable flag from test
Daniele Varrazzo [Tue, 1 Dec 2020 03:13:15 +0000 (03:13 +0000)]
Added missing file headers
Daniele Varrazzo [Tue, 1 Dec 2020 03:04:56 +0000 (03:04 +0000)]
Added test to check rowcount works after execmany returning tuples
Daniele Varrazzo [Tue, 1 Dec 2020 02:54:56 +0000 (02:54 +0000)]
Cursor.description can be pickled
Daniele Varrazzo [Tue, 1 Dec 2020 01:53:45 +0000 (01:53 +0000)]
Include typing information in packages
Daniele Varrazzo [Tue, 1 Dec 2020 00:55:02 +0000 (00:55 +0000)]
Dumper and Loader made abstract classes
Daniele Varrazzo [Tue, 1 Dec 2020 00:20:51 +0000 (00:20 +0000)]
Dropped register_binary() method from Loader and Dumper
Use the format parameter on register(): documented and made public.
Daniele Varrazzo [Thu, 26 Nov 2020 19:49:33 +0000 (19:49 +0000)]
Main interest point in docs landing page
Daniele Varrazzo [Thu, 26 Nov 2020 12:44:54 +0000 (12:44 +0000)]
Fixed doc ref
Paolo Melchiorre [Thu, 26 Nov 2020 08:48:18 +0000 (09:48 +0100)]
Fix #16 Use svg logo in documentation
Daniel Fortunov [Thu, 26 Nov 2020 08:33:53 +0000 (08:33 +0000)]
Windows compatibility for tests
* Skip test_connect_timeout() on Windows for the time being as
Connection.connect() hangs for some reason. This skip can probably
go away once connection timeouts are implemented.
* test_multiprocess_close(): Turn LocalPath instance back into a str
before putting it back into env["PYTHONPATH"] to avoid failure in:
_winapi.CreateProcess(): TypeError: environment can only contain str
Daniele Varrazzo [Thu, 26 Nov 2020 12:14:33 +0000 (12:14 +0000)]
Maybe unbreak website generation on travis
Daniele Varrazzo [Thu, 26 Nov 2020 01:14:33 +0000 (01:14 +0000)]
Added a main level to the docs
Docs split in several page with better visibility of titles.
Also adding a sort of narrative with several cross links between topics.
Daniele Varrazzo [Thu, 26 Nov 2020 02:52:24 +0000 (02:52 +0000)]
More contrasty pygment style
Daniele Varrazzo [Wed, 25 Nov 2020 23:52:52 +0000 (23:52 +0000)]
Uppercase admonitions in docs
With the furo theme it's pretty clear that they are at the start of a
sentence.
Daniele Varrazzo [Wed, 25 Nov 2020 23:58:50 +0000 (23:58 +0000)]
Merge branch 'docs-furo'
Daniele Varrazzo [Wed, 25 Nov 2020 23:30:36 +0000 (23:30 +0000)]
Take docs announcement out of repos
Moved to the website.
Daniele Varrazzo [Wed, 25 Nov 2020 20:24:29 +0000 (20:24 +0000)]
Furo style tweaked
- non smaller font in admonitions
- rubric styled.
Paolo Melchiorre [Wed, 25 Nov 2020 16:00:41 +0000 (17:00 +0100)]
Fix #13 Use a responsive docs theme
Daniel Fortunov [Sun, 19 Jul 2020 23:19:21 +0000 (00:19 +0100)]
Adapt find_library() call to find libpq.dll on Windows
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
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
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.
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.
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.
Daniele Varrazzo [Tue, 24 Nov 2020 01:18:57 +0000 (01:18 +0000)]
Import pq enums in modules where they are used
Daniele Varrazzo [Tue, 24 Nov 2020 00:29:13 +0000 (00:29 +0000)]
Call the params params, not vars
Daniele Varrazzo [Tue, 24 Nov 2020 00:11:44 +0000 (00:11 +0000)]
Queries modume moved out of utils package
Daniele Varrazzo [Mon, 23 Nov 2020 23:53:25 +0000 (23:53 +0000)]
Added some docs about adaptation
Daniele Varrazzo [Mon, 23 Nov 2020 15:27:37 +0000 (15:27 +0000)]
Fixed broken tests after fixing async connection discrepancies
Daniele Varrazzo [Mon, 23 Nov 2020 15:11:44 +0000 (15:11 +0000)]
Fixed tiny diffreences in behaviour between sync and async code
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.
Daniele Varrazzo [Mon, 23 Nov 2020 08:44:46 +0000 (08:44 +0000)]
Added Cursor.query and params.
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.
Daniele Varrazzo [Mon, 23 Nov 2020 07:14:17 +0000 (07:14 +0000)]
Added some documentation on the adaptation system
Daniele Varrazzo [Mon, 23 Nov 2020 05:28:43 +0000 (05:28 +0000)]
Added initial docs for psycopg3.pq module
Daniele Varrazzo [Mon, 23 Nov 2020 05:23:48 +0000 (05:23 +0000)]
Added installation instructions including the binary package
Daniele Varrazzo [Sun, 22 Nov 2020 23:39:09 +0000 (23:39 +0000)]
Use the build script to build source packages too
Daniele Varrazzo [Sun, 22 Nov 2020 21:51:20 +0000 (21:51 +0000)]
Create the psycopg3-binary package
Daniele Varrazzo [Sun, 22 Nov 2020 21:37:53 +0000 (21:37 +0000)]
Added in-progress script to build wheel packages
Daniele Varrazzo [Sun, 22 Nov 2020 18:46:55 +0000 (18:46 +0000)]
Pure Python implementation called 'python', not 'ctypes'
Daniele Varrazzo [Sun, 22 Nov 2020 18:36:41 +0000 (18:36 +0000)]
Use "pip install psycogp3[c]" to install the C extension
Daniele Varrazzo [Sun, 22 Nov 2020 17:44:20 +0000 (17:44 +0000)]
Merge branch 'c-dumpers'
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.
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.
Daniele Varrazzo [Sun, 22 Nov 2020 16:15:02 +0000 (16:15 +0000)]
Cursor.connection made a read-only property
Daniele Varrazzo [Sun, 22 Nov 2020 16:13:31 +0000 (16:13 +0000)]
Dropped "-> None" from function returning no result in docs
Daniele Varrazzo [Sun, 22 Nov 2020 04:32:01 +0000 (04:32 +0000)]
Added errors module documentation
Daniele Varrazzo [Sun, 22 Nov 2020 02:33:36 +0000 (02:33 +0000)]
Added documentation for the `sql` module
Daniele Varrazzo [Sat, 21 Nov 2020 23:09:16 +0000 (23:09 +0000)]
Added C string dumpers
Daniele Varrazzo [Sat, 21 Nov 2020 23:08:36 +0000 (23:08 +0000)]
C Dumpers and Loaders attributes readable from Python
Daniele Varrazzo [Sat, 21 Nov 2020 23:07:31 +0000 (23:07 +0000)]
Use the right class instantiating a dumper on a subclass
Daniele Varrazzo [Sat, 21 Nov 2020 21:38:21 +0000 (21:38 +0000)]
Added oid constants in cython extension
Daniele Varrazzo [Sat, 21 Nov 2020 20:33:51 +0000 (20:33 +0000)]
Added C bool dumpers (text, binary)
Daniele Varrazzo [Sat, 21 Nov 2020 20:17:26 +0000 (20:17 +0000)]
Added C implementation of int dumpers (text, binary)
Daniele Varrazzo [Sat, 21 Nov 2020 17:23:27 +0000 (17:23 +0000)]
s/loaders/adapters/ where there will be dumpers too
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.
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.
Daniele Varrazzo [Fri, 20 Nov 2020 02:59:22 +0000 (02:59 +0000)]
Added test to verify can't execute(copy)
Daniele Varrazzo [Thu, 19 Nov 2020 23:23:19 +0000 (23:23 +0000)]
Typo in async with example fixed
Daniele Varrazzo [Thu, 19 Nov 2020 19:29:57 +0000 (19:29 +0000)]
Document async with connection and cursor
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__.
Daniele Varrazzo [Thu, 19 Nov 2020 15:27:03 +0000 (15:27 +0000)]
Fixed async copy example
Daniele Varrazzo [Thu, 19 Nov 2020 14:43:08 +0000 (14:43 +0000)]
Added rollback case to the transaction block example