PyGreSQL 6.0.1__tar.gz → 6.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pygresql-6.0.1 → pygresql-6.1.0}/PKG-INFO +4 -3
- {pygresql-6.0.1 → pygresql-6.1.0}/PyGreSQL.egg-info/PKG-INFO +4 -3
- {pygresql-6.0.1 → pygresql-6.1.0}/README.rst +2 -2
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/about.rst +2 -2
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/changelog.rst +4 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/install.rst +1 -1
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/db_wrapper.rst +1 -1
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/__init__.py +80 -28
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/adapt.py +8 -2
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/cast.py +14 -4
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/core.py +68 -24
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/error.py +6 -1
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/helpers.py +8 -2
- {pygresql-6.0.1 → pygresql-6.1.0}/pgdb/__init__.py +56 -15
- {pygresql-6.0.1 → pygresql-6.1.0}/pgdb/adapt.py +30 -6
- {pygresql-6.0.1 → pygresql-6.1.0}/pgdb/cast.py +18 -5
- {pygresql-6.0.1 → pygresql-6.1.0}/pyproject.toml +3 -2
- {pygresql-6.0.1 → pygresql-6.1.0}/setup.py +2 -1
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_classic_connection.py +7 -7
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_classic_dbwrapper.py +2 -2
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_classic_functions.py +2 -2
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_classic_largeobj.py +7 -8
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_dbapi20.py +1 -1
- {pygresql-6.0.1 → pygresql-6.1.0}/tox.ini +15 -12
- {pygresql-6.0.1 → pygresql-6.1.0}/LICENSE.txt +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/MANIFEST.in +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/PyGreSQL.egg-info/SOURCES.txt +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/PyGreSQL.egg-info/dependency_links.txt +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/PyGreSQL.egg-info/not-zip-safe +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/PyGreSQL.egg-info/top_level.txt +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/Makefile +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/_static/favicon.ico +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/_static/pygresql.png +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/community/homes.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/community/index.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/community/issues.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/community/mailinglist.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/community/source.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/community/support.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/conf.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/examples.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/general.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/index.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/adaptation.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/connection.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/db_types.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/index.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/introduction.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/large_objects.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/module.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/notification.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pg/query.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pgdb/adaptation.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pgdb/connection.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pgdb/cursor.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pgdb/index.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pgdb/introduction.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pgdb/module.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pgdb/typecache.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/pgdb/types.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/postgres/advanced.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/postgres/basic.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/postgres/func.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/postgres/index.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/postgres/syscat.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/contents/tutorial.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/copyright.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/download/download.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/download/files.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/download/index.rst +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/make.bat +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/docs/requirements.txt +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/ext/pgconn.c +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/ext/pginternal.c +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/ext/pglarge.c +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/ext/pgmodule.c +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/ext/pgnotice.c +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/ext/pgquery.c +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/ext/pgsource.c +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/ext/pgtypes.h +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/_pg.pyi +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/attrs.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/db.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/notify.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/py.typed +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pg/tz.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pgdb/connect.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pgdb/connection.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pgdb/constants.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pgdb/cursor.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pgdb/py.typed +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/pgdb/typecode.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/setup.cfg +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/__init__.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/config.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/dbapi20.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_classic.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_classic_attrdict.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_classic_notification.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_dbapi20_copy.py +0 -0
- {pygresql-6.0.1 → pygresql-6.1.0}/tests/test_tutorial.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyGreSQL
|
|
3
|
-
Version: 6.0
|
|
3
|
+
Version: 6.1.0
|
|
4
4
|
Summary: Python PostgreSQL interfaces
|
|
5
5
|
Home-page: https://pygresql.github.io/
|
|
6
6
|
Download-URL: https://pygresql.github.io/download/
|
|
@@ -58,6 +58,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
58
58
|
Classifier: Programming Language :: Python :: 3.10
|
|
59
59
|
Classifier: Programming Language :: Python :: 3.11
|
|
60
60
|
Classifier: Programming Language :: Python :: 3.12
|
|
61
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
61
62
|
Classifier: Programming Language :: SQL
|
|
62
63
|
Classifier: Topic :: Database
|
|
63
64
|
Classifier: Topic :: Database :: Front-Ends
|
|
@@ -86,8 +87,8 @@ The following Python versions are supported:
|
|
|
86
87
|
* PyGreSQL 5.x: Python 2 and Python 3
|
|
87
88
|
* PyGreSQL 6.x and newer: Python 3 only
|
|
88
89
|
|
|
89
|
-
The current version of PyGreSQL supports Python versions 3.7 to 3.
|
|
90
|
-
and PostgreSQL versions 10 to
|
|
90
|
+
The current version of PyGreSQL supports Python versions 3.7 to 3.13
|
|
91
|
+
and PostgreSQL versions 10 to 17 on the server.
|
|
91
92
|
|
|
92
93
|
Installation
|
|
93
94
|
------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyGreSQL
|
|
3
|
-
Version: 6.0
|
|
3
|
+
Version: 6.1.0
|
|
4
4
|
Summary: Python PostgreSQL interfaces
|
|
5
5
|
Home-page: https://pygresql.github.io/
|
|
6
6
|
Download-URL: https://pygresql.github.io/download/
|
|
@@ -58,6 +58,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
58
58
|
Classifier: Programming Language :: Python :: 3.10
|
|
59
59
|
Classifier: Programming Language :: Python :: 3.11
|
|
60
60
|
Classifier: Programming Language :: Python :: 3.12
|
|
61
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
61
62
|
Classifier: Programming Language :: SQL
|
|
62
63
|
Classifier: Topic :: Database
|
|
63
64
|
Classifier: Topic :: Database :: Front-Ends
|
|
@@ -86,8 +87,8 @@ The following Python versions are supported:
|
|
|
86
87
|
* PyGreSQL 5.x: Python 2 and Python 3
|
|
87
88
|
* PyGreSQL 6.x and newer: Python 3 only
|
|
88
89
|
|
|
89
|
-
The current version of PyGreSQL supports Python versions 3.7 to 3.
|
|
90
|
-
and PostgreSQL versions 10 to
|
|
90
|
+
The current version of PyGreSQL supports Python versions 3.7 to 3.13
|
|
91
|
+
and PostgreSQL versions 10 to 17 on the server.
|
|
91
92
|
|
|
92
93
|
Installation
|
|
93
94
|
------------
|
|
@@ -18,8 +18,8 @@ The following Python versions are supported:
|
|
|
18
18
|
* PyGreSQL 5.x: Python 2 and Python 3
|
|
19
19
|
* PyGreSQL 6.x and newer: Python 3 only
|
|
20
20
|
|
|
21
|
-
The current version of PyGreSQL supports Python versions 3.7 to 3.
|
|
22
|
-
and PostgreSQL versions 10 to
|
|
21
|
+
The current version of PyGreSQL supports Python versions 3.7 to 3.13
|
|
22
|
+
and PostgreSQL versions 10 to 17 on the server.
|
|
23
23
|
|
|
24
24
|
Installation
|
|
25
25
|
------------
|
|
@@ -39,6 +39,6 @@ on the PyGres95 code written by Pascal Andre (andre@chimay.via.ecp.fr).
|
|
|
39
39
|
D'Arcy (darcy@druid.net) renamed it to PyGreSQL starting with
|
|
40
40
|
version 2.0 and serves as the "BDFL" of PyGreSQL.
|
|
41
41
|
|
|
42
|
-
The current version PyGreSQL |version| needs PostgreSQL 10 to
|
|
43
|
-
3.7 to 3.
|
|
42
|
+
The current version PyGreSQL |version| needs PostgreSQL 10 to 17, and Python
|
|
43
|
+
3.7 to 3.13. If you need to support older PostgreSQL or Python versions,
|
|
44
44
|
you can resort to the PyGreSQL 5.x versions that still support them.
|
|
@@ -14,7 +14,7 @@ On Windows, you also need to make sure that the directory that contains
|
|
|
14
14
|
``libpq.dll`` is part of your ``PATH`` environment variable.
|
|
15
15
|
|
|
16
16
|
The current version of PyGreSQL has been tested with Python versions
|
|
17
|
-
3.7 to 3.
|
|
17
|
+
3.7 to 3.13, and PostgreSQL versions 10 to 17.
|
|
18
18
|
|
|
19
19
|
PyGreSQL will be installed as two packages named ``pg`` (for the classic
|
|
20
20
|
interface) and ``pgdb`` (for the DB API 2 compliant interface). The former
|
|
@@ -715,7 +715,7 @@ delete -- delete a row from a database table
|
|
|
715
715
|
Delete a row from a database table
|
|
716
716
|
|
|
717
717
|
:param str table: name of table
|
|
718
|
-
:param dict
|
|
718
|
+
:param dict row: optional dictionary of values
|
|
719
719
|
:param col: optional keyword arguments for updating the dictionary
|
|
720
720
|
:rtype: None
|
|
721
721
|
:raises pg.ProgrammingError: table has no primary key,
|
|
@@ -99,34 +99,86 @@ from .helpers import RowCache, init_core
|
|
|
99
99
|
from .notify import NotificationHandler
|
|
100
100
|
|
|
101
101
|
__all__ = [
|
|
102
|
-
'DB',
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
'
|
|
109
|
-
'
|
|
110
|
-
'
|
|
111
|
-
'
|
|
112
|
-
'
|
|
113
|
-
'
|
|
114
|
-
'
|
|
115
|
-
'
|
|
116
|
-
'TRANS_ACTIVE',
|
|
117
|
-
'
|
|
118
|
-
'
|
|
119
|
-
'
|
|
120
|
-
'
|
|
121
|
-
'
|
|
122
|
-
'
|
|
123
|
-
'
|
|
124
|
-
'
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
'
|
|
129
|
-
'
|
|
102
|
+
'DB',
|
|
103
|
+
'INV_READ',
|
|
104
|
+
'INV_WRITE',
|
|
105
|
+
'POLLING_FAILED',
|
|
106
|
+
'POLLING_OK',
|
|
107
|
+
'POLLING_READING',
|
|
108
|
+
'POLLING_WRITING',
|
|
109
|
+
'RESULT_DDL',
|
|
110
|
+
'RESULT_DML',
|
|
111
|
+
'RESULT_DQL',
|
|
112
|
+
'RESULT_EMPTY',
|
|
113
|
+
'SEEK_CUR',
|
|
114
|
+
'SEEK_END',
|
|
115
|
+
'SEEK_SET',
|
|
116
|
+
'TRANS_ACTIVE',
|
|
117
|
+
'TRANS_IDLE',
|
|
118
|
+
'TRANS_INERROR',
|
|
119
|
+
'TRANS_INTRANS',
|
|
120
|
+
'TRANS_UNKNOWN',
|
|
121
|
+
'Adapter',
|
|
122
|
+
'Bytea',
|
|
123
|
+
'Connection',
|
|
124
|
+
'DataError',
|
|
125
|
+
'DatabaseError',
|
|
126
|
+
'Error',
|
|
127
|
+
'Hstore',
|
|
128
|
+
'IntegrityError',
|
|
129
|
+
'InterfaceError',
|
|
130
|
+
'InternalError',
|
|
131
|
+
'InvalidResultError',
|
|
132
|
+
'Json',
|
|
133
|
+
'Literal',
|
|
134
|
+
'MultipleResultsError',
|
|
135
|
+
'NoResultError',
|
|
136
|
+
'NotSupportedError',
|
|
137
|
+
'NotificationHandler',
|
|
138
|
+
'OperationalError',
|
|
139
|
+
'ProgrammingError',
|
|
140
|
+
'Query',
|
|
141
|
+
'RowCache',
|
|
142
|
+
'Typecasts',
|
|
143
|
+
'Warning',
|
|
144
|
+
'__version__',
|
|
145
|
+
'cast_array',
|
|
146
|
+
'cast_hstore',
|
|
147
|
+
'cast_record',
|
|
148
|
+
'connect',
|
|
149
|
+
'escape_bytea',
|
|
150
|
+
'escape_string',
|
|
151
|
+
'get_array',
|
|
152
|
+
'get_bool',
|
|
153
|
+
'get_bytea_escaped',
|
|
154
|
+
'get_datestyle',
|
|
155
|
+
'get_decimal',
|
|
156
|
+
'get_decimal_point',
|
|
157
|
+
'get_defbase',
|
|
158
|
+
'get_defhost',
|
|
159
|
+
'get_defopt',
|
|
160
|
+
'get_defport',
|
|
161
|
+
'get_defuser',
|
|
162
|
+
'get_jsondecode',
|
|
163
|
+
'get_pqlib_version',
|
|
164
|
+
'get_typecast',
|
|
165
|
+
'set_array',
|
|
166
|
+
'set_bool',
|
|
167
|
+
'set_bytea_escaped',
|
|
168
|
+
'set_datestyle',
|
|
169
|
+
'set_decimal',
|
|
170
|
+
'set_decimal_point',
|
|
171
|
+
'set_defbase',
|
|
172
|
+
'set_defhost',
|
|
173
|
+
'set_defopt',
|
|
174
|
+
'set_defpasswd',
|
|
175
|
+
'set_defport',
|
|
176
|
+
'set_defuser',
|
|
177
|
+
'set_jsondecode',
|
|
178
|
+
'set_query_helpers',
|
|
179
|
+
'set_typecast',
|
|
180
|
+
'unescape_bytea',
|
|
181
|
+
'version',
|
|
130
182
|
]
|
|
131
183
|
|
|
132
184
|
__version__ = version
|
|
@@ -21,8 +21,14 @@ if TYPE_CHECKING:
|
|
|
21
21
|
from .db import DB
|
|
22
22
|
|
|
23
23
|
__all__ = [
|
|
24
|
-
'
|
|
25
|
-
'
|
|
24
|
+
'UUID',
|
|
25
|
+
'Adapter',
|
|
26
|
+
'Bytea',
|
|
27
|
+
'DbType',
|
|
28
|
+
'DbTypes',
|
|
29
|
+
'Hstore',
|
|
30
|
+
'Json',
|
|
31
|
+
'Literal'
|
|
26
32
|
]
|
|
27
33
|
|
|
28
34
|
|
|
@@ -25,10 +25,20 @@ from .core import (
|
|
|
25
25
|
from .tz import timezone_as_offset
|
|
26
26
|
|
|
27
27
|
__all__ = [
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
28
|
+
'Typecasts',
|
|
29
|
+
'cast_bool',
|
|
30
|
+
'cast_date',
|
|
31
|
+
'cast_int2vector',
|
|
32
|
+
'cast_interval',
|
|
33
|
+
'cast_json',
|
|
34
|
+
'cast_money',
|
|
35
|
+
'cast_num',
|
|
36
|
+
'cast_time',
|
|
37
|
+
'cast_timestamp',
|
|
38
|
+
'cast_timestamptz',
|
|
39
|
+
'cast_timetz',
|
|
40
|
+
'get_typecast',
|
|
41
|
+
'set_typecast'
|
|
32
42
|
]
|
|
33
43
|
|
|
34
44
|
def get_args(func: Callable) -> list:
|
|
@@ -108,29 +108,73 @@ from ._pg import (
|
|
|
108
108
|
)
|
|
109
109
|
|
|
110
110
|
__all__ = [
|
|
111
|
-
'
|
|
112
|
-
'
|
|
113
|
-
'
|
|
114
|
-
'
|
|
115
|
-
'
|
|
116
|
-
'
|
|
117
|
-
'
|
|
118
|
-
'
|
|
119
|
-
'
|
|
120
|
-
'
|
|
121
|
-
'SEEK_CUR',
|
|
122
|
-
'
|
|
123
|
-
'
|
|
124
|
-
'
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
'
|
|
129
|
-
'
|
|
130
|
-
'
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'
|
|
134
|
-
'
|
|
111
|
+
'INV_READ',
|
|
112
|
+
'INV_WRITE',
|
|
113
|
+
'POLLING_FAILED',
|
|
114
|
+
'POLLING_OK',
|
|
115
|
+
'POLLING_READING',
|
|
116
|
+
'POLLING_WRITING',
|
|
117
|
+
'RESULT_DDL',
|
|
118
|
+
'RESULT_DML',
|
|
119
|
+
'RESULT_DQL',
|
|
120
|
+
'RESULT_EMPTY',
|
|
121
|
+
'SEEK_CUR',
|
|
122
|
+
'SEEK_END',
|
|
123
|
+
'SEEK_SET',
|
|
124
|
+
'TRANS_ACTIVE',
|
|
125
|
+
'TRANS_IDLE',
|
|
126
|
+
'TRANS_INERROR',
|
|
127
|
+
'TRANS_INTRANS',
|
|
128
|
+
'TRANS_UNKNOWN',
|
|
129
|
+
'Connection',
|
|
130
|
+
'DataError',
|
|
131
|
+
'DatabaseError',
|
|
132
|
+
'Error',
|
|
133
|
+
'IntegrityError',
|
|
134
|
+
'InterfaceError',
|
|
135
|
+
'InternalError',
|
|
136
|
+
'InvalidResultError',
|
|
137
|
+
'LargeObject',
|
|
138
|
+
'MultipleResultsError',
|
|
139
|
+
'NoResultError',
|
|
140
|
+
'NotSupportedError',
|
|
141
|
+
'OperationalError',
|
|
142
|
+
'ProgrammingError',
|
|
143
|
+
'Query',
|
|
144
|
+
'Warning',
|
|
145
|
+
'cast_array',
|
|
146
|
+
'cast_hstore',
|
|
147
|
+
'cast_record',
|
|
148
|
+
'connect',
|
|
149
|
+
'escape_bytea',
|
|
150
|
+
'escape_string',
|
|
151
|
+
'get_array',
|
|
152
|
+
'get_bool',
|
|
153
|
+
'get_bytea_escaped',
|
|
154
|
+
'get_datestyle',
|
|
155
|
+
'get_decimal',
|
|
156
|
+
'get_decimal_point',
|
|
157
|
+
'get_defbase',
|
|
158
|
+
'get_defhost',
|
|
159
|
+
'get_defopt',
|
|
160
|
+
'get_defport',
|
|
161
|
+
'get_defuser',
|
|
162
|
+
'get_jsondecode',
|
|
163
|
+
'get_pqlib_version',
|
|
164
|
+
'set_array',
|
|
165
|
+
'set_bool',
|
|
166
|
+
'set_bytea_escaped',
|
|
167
|
+
'set_datestyle',
|
|
168
|
+
'set_decimal',
|
|
169
|
+
'set_decimal_point',
|
|
170
|
+
'set_defbase',
|
|
171
|
+
'set_defhost',
|
|
172
|
+
'set_defopt',
|
|
173
|
+
'set_defpasswd',
|
|
174
|
+
'set_defport',
|
|
175
|
+
'set_defuser',
|
|
176
|
+
'set_jsondecode',
|
|
177
|
+
'set_query_helpers',
|
|
178
|
+
'unescape_bytea',
|
|
135
179
|
'version',
|
|
136
180
|
]
|
|
@@ -13,8 +13,14 @@ from .core import Query, set_decimal, set_jsondecode, set_query_helpers
|
|
|
13
13
|
SomeNamedTuple = Any # alias for accessing arbitrary named tuples
|
|
14
14
|
|
|
15
15
|
__all__ = [
|
|
16
|
-
'
|
|
17
|
-
'
|
|
16
|
+
'QuoteDict',
|
|
17
|
+
'RowCache',
|
|
18
|
+
'dictiter',
|
|
19
|
+
'namediter',
|
|
20
|
+
'namednext',
|
|
21
|
+
'oid_key',
|
|
22
|
+
'quote_if_unqualified',
|
|
23
|
+
'scalariter'
|
|
18
24
|
]
|
|
19
25
|
|
|
20
26
|
|
|
@@ -121,21 +121,62 @@ from .constants import apilevel, paramstyle, shortcutmethods, threadsafety
|
|
|
121
121
|
from .cursor import Cursor
|
|
122
122
|
|
|
123
123
|
__all__ = [
|
|
124
|
-
'
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
'
|
|
129
|
-
'
|
|
130
|
-
'
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'
|
|
134
|
-
'
|
|
135
|
-
'
|
|
136
|
-
'
|
|
137
|
-
'
|
|
138
|
-
'
|
|
124
|
+
'ARRAY',
|
|
125
|
+
'BINARY',
|
|
126
|
+
'BOOL',
|
|
127
|
+
'DATE',
|
|
128
|
+
'DATETIME',
|
|
129
|
+
'FLOAT',
|
|
130
|
+
'HSTORE',
|
|
131
|
+
'INTEGER',
|
|
132
|
+
'INTERVAL',
|
|
133
|
+
'JSON',
|
|
134
|
+
'LONG',
|
|
135
|
+
'MONEY',
|
|
136
|
+
'NUMBER',
|
|
137
|
+
'NUMERIC',
|
|
138
|
+
'RECORD',
|
|
139
|
+
'ROWID',
|
|
140
|
+
'SMALLINT',
|
|
141
|
+
'STRING',
|
|
142
|
+
'TIME',
|
|
143
|
+
'TIMESTAMP',
|
|
144
|
+
'UUID',
|
|
145
|
+
'Binary',
|
|
146
|
+
'Connection',
|
|
147
|
+
'Cursor',
|
|
148
|
+
'DataError',
|
|
149
|
+
'DatabaseError',
|
|
150
|
+
'Date',
|
|
151
|
+
'DateFromTicks',
|
|
152
|
+
'DbType',
|
|
153
|
+
'Error',
|
|
154
|
+
'Hstore',
|
|
155
|
+
'IntegrityError',
|
|
156
|
+
'InterfaceError',
|
|
157
|
+
'InternalError',
|
|
158
|
+
'Interval',
|
|
159
|
+
'Json',
|
|
160
|
+
'Literal',
|
|
161
|
+
'NotSupportedError',
|
|
162
|
+
'OperationalError',
|
|
163
|
+
'ProgrammingError',
|
|
164
|
+
'Time',
|
|
165
|
+
'TimeFromTicks',
|
|
166
|
+
'Timestamp',
|
|
167
|
+
'TimestampFromTicks',
|
|
168
|
+
'Uuid',
|
|
169
|
+
'Warning',
|
|
170
|
+
'__version__',
|
|
171
|
+
'apilevel',
|
|
172
|
+
'connect',
|
|
173
|
+
'get_typecast',
|
|
174
|
+
'paramstyle',
|
|
175
|
+
'reset_typecast',
|
|
176
|
+
'set_typecast',
|
|
177
|
+
'shortcutmethods',
|
|
178
|
+
'threadsafety',
|
|
179
|
+
'version',
|
|
139
180
|
]
|
|
140
181
|
|
|
141
182
|
__version__ = version
|
|
@@ -12,12 +12,36 @@ from uuid import UUID as Uuid # noqa: N811
|
|
|
12
12
|
from .typecode import TypeCode
|
|
13
13
|
|
|
14
14
|
__all__ = [
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
15
|
+
'ARRAY',
|
|
16
|
+
'BINARY',
|
|
17
|
+
'BOOL',
|
|
18
|
+
'DATE',
|
|
19
|
+
'DATETIME',
|
|
20
|
+
'FLOAT',
|
|
21
|
+
'HSTORE',
|
|
22
|
+
'INTEGER',
|
|
23
|
+
'INTERVAL',
|
|
24
|
+
'JSON',
|
|
25
|
+
'LONG',
|
|
26
|
+
'MONEY',
|
|
27
|
+
'NUMBER',
|
|
28
|
+
'NUMERIC',
|
|
29
|
+
'RECORD',
|
|
30
|
+
'ROWID',
|
|
31
|
+
'SMALLINT',
|
|
32
|
+
'STRING',
|
|
33
|
+
'TIME',
|
|
34
|
+
'TIMESTAMP',
|
|
35
|
+
'UUID',
|
|
36
|
+
'ArrayType',
|
|
37
|
+
'Date',
|
|
38
|
+
'DateFromTicks',
|
|
39
|
+
'DbType',
|
|
40
|
+
'RecordType',
|
|
41
|
+
'Time',
|
|
42
|
+
'TimeFromTicks',
|
|
43
|
+
'Timestamp',
|
|
44
|
+
'TimestampFromTicks'
|
|
21
45
|
|
|
22
46
|
]
|
|
23
47
|
|
|
@@ -24,11 +24,24 @@ from pg.core import (
|
|
|
24
24
|
from .typecode import TypeCode
|
|
25
25
|
|
|
26
26
|
__all__ = [
|
|
27
|
-
'Decimal',
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'Typecasts',
|
|
27
|
+
'Decimal',
|
|
28
|
+
'FieldInfo',
|
|
29
|
+
'LocalTypecasts',
|
|
30
|
+
'TypeCache',
|
|
31
|
+
'Typecasts',
|
|
32
|
+
'cast_bool',
|
|
33
|
+
'cast_date',
|
|
34
|
+
'cast_int2vector',
|
|
35
|
+
'cast_interval',
|
|
36
|
+
'cast_money',
|
|
37
|
+
'cast_time',
|
|
38
|
+
'cast_timestamp',
|
|
39
|
+
'cast_timestamptz',
|
|
40
|
+
'cast_timetz',
|
|
41
|
+
'decimal_type',
|
|
42
|
+
'get_typecast',
|
|
43
|
+
'reset_typecast',
|
|
44
|
+
'set_typecast'
|
|
32
45
|
]
|
|
33
46
|
|
|
34
47
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "PyGreSQL"
|
|
3
|
-
version = "6.0
|
|
3
|
+
version = "6.1.0"
|
|
4
4
|
requires-python = ">=3.7"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "D'Arcy J. M. Cain", email = "darcy@pygresql.org"},
|
|
@@ -23,6 +23,7 @@ classifiers = [
|
|
|
23
23
|
"Programming Language :: Python :: 3.10",
|
|
24
24
|
"Programming Language :: Python :: 3.11",
|
|
25
25
|
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
26
27
|
"Programming Language :: SQL",
|
|
27
28
|
"Topic :: Database",
|
|
28
29
|
"Topic :: Database :: Front-Ends",
|
|
@@ -78,7 +79,7 @@ ignore = ["D203", "D213"]
|
|
|
78
79
|
"tests/*.py" = ["D100", "D101", "D102", "D103", "D105", "D107", "S"]
|
|
79
80
|
|
|
80
81
|
[tool.mypy]
|
|
81
|
-
python_version = "3.
|
|
82
|
+
python_version = "3.13"
|
|
82
83
|
check_untyped_defs = true
|
|
83
84
|
no_implicit_optional = true
|
|
84
85
|
strict_optional = true
|
|
@@ -136,7 +136,7 @@ class build_pg_ext(build_ext): # noqa: N801
|
|
|
136
136
|
define_macros.append(('MS_WIN64', None))
|
|
137
137
|
elif compiler == 'msvc': # Microsoft Visual C++
|
|
138
138
|
extra_compile_args[1:] = [
|
|
139
|
-
'-J', '-W3', '-WX',
|
|
139
|
+
'-J', '-W3', '-WX', '-wd4391',
|
|
140
140
|
'-Dinline=__inline'] # needed for MSVC 9
|
|
141
141
|
|
|
142
142
|
|
|
@@ -170,6 +170,7 @@ setup(
|
|
|
170
170
|
'Programming Language :: Python :: 3.10',
|
|
171
171
|
'Programming Language :: Python :: 3.11',
|
|
172
172
|
'Programming Language :: Python :: 3.12',
|
|
173
|
+
'Programming Language :: Python :: 3.13',
|
|
173
174
|
'Programming Language :: SQL',
|
|
174
175
|
'Topic :: Database',
|
|
175
176
|
'Topic :: Database :: Front-Ends',
|
|
@@ -174,8 +174,8 @@ class TestConnectObject(unittest.TestCase):
|
|
|
174
174
|
def test_attribute_server_version(self):
|
|
175
175
|
server_version = self.connection.server_version
|
|
176
176
|
self.assertIsInstance(server_version, int)
|
|
177
|
-
self.assertGreaterEqual(server_version, 100000)
|
|
178
|
-
self.assertLess(server_version,
|
|
177
|
+
self.assertGreaterEqual(server_version, 100000) # >= 10.0
|
|
178
|
+
self.assertLess(server_version, 190000) # < 20.0
|
|
179
179
|
|
|
180
180
|
def test_attribute_socket(self):
|
|
181
181
|
socket = self.connection.socket
|
|
@@ -984,7 +984,7 @@ class TestParamQueries(unittest.TestCase):
|
|
|
984
984
|
pg.set_bool(bool_enabled)
|
|
985
985
|
try:
|
|
986
986
|
bool_on = bool_enabled or bool_enabled is None
|
|
987
|
-
v_false, v_true = (False, True) if bool_on else '
|
|
987
|
+
v_false, v_true = (False, True) if bool_on else ('f', 't')
|
|
988
988
|
r_false, r_true = [(v_false,)], [(v_true,)]
|
|
989
989
|
self.assertEqual(query("select false").getresult(), r_false)
|
|
990
990
|
self.assertEqual(query("select true").getresult(), r_true)
|
|
@@ -1997,10 +1997,10 @@ class TestInserttable(unittest.TestCase):
|
|
|
1997
1997
|
row_bytes = tuple(
|
|
1998
1998
|
s.encode() if isinstance(s, str) else s
|
|
1999
1999
|
for s in row_unicode)
|
|
2000
|
-
|
|
2001
|
-
self.c.inserttable('test',
|
|
2002
|
-
|
|
2003
|
-
self.assertEqual(self.get_back(),
|
|
2000
|
+
data_bytes = [row_bytes] * 2
|
|
2001
|
+
self.c.inserttable('test', data_bytes)
|
|
2002
|
+
data_unicode = [row_unicode] * 2
|
|
2003
|
+
self.assertEqual(self.get_back(), data_unicode)
|
|
2004
2004
|
|
|
2005
2005
|
def test_inserttable_unicode_utf8(self):
|
|
2006
2006
|
try:
|
|
@@ -168,8 +168,8 @@ class TestDBClassBasic(unittest.TestCase):
|
|
|
168
168
|
def test_attribute_server_version(self):
|
|
169
169
|
server_version = self.db.server_version
|
|
170
170
|
self.assertIsInstance(server_version, int)
|
|
171
|
-
self.assertGreaterEqual(server_version, 100000)
|
|
172
|
-
self.assertLess(server_version,
|
|
171
|
+
self.assertGreaterEqual(server_version, 100000) # >= 10.0
|
|
172
|
+
self.assertLess(server_version, 200000) # < 20.0
|
|
173
173
|
self.assertEqual(server_version, self.db.db.server_version)
|
|
174
174
|
|
|
175
175
|
def test_attribute_socket(self):
|
|
@@ -124,8 +124,8 @@ class TestHasConnect(unittest.TestCase):
|
|
|
124
124
|
# noinspection PyUnresolvedReferences
|
|
125
125
|
v = pg.get_pqlib_version()
|
|
126
126
|
self.assertIsInstance(v, int)
|
|
127
|
-
self.assertGreater(v, 100000)
|
|
128
|
-
self.assertLess(v,
|
|
127
|
+
self.assertGreater(v, 100000) # >= 10.0
|
|
128
|
+
self.assertLess(v, 200000) # < 20.0
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
class TestParseArray(unittest.TestCase):
|
|
@@ -112,7 +112,7 @@ class TestCreatingLargeObjects(unittest.TestCase):
|
|
|
112
112
|
fname = 'temp_test_pg_largeobj_import.txt'
|
|
113
113
|
f = open(fname, 'wb') # noqa: SIM115
|
|
114
114
|
else:
|
|
115
|
-
f = tempfile.NamedTemporaryFile()
|
|
115
|
+
f = tempfile.NamedTemporaryFile() # noqa: SIM115
|
|
116
116
|
fname = f.name
|
|
117
117
|
data = b'some data to be imported'
|
|
118
118
|
f.write(data)
|
|
@@ -420,7 +420,7 @@ class TestLargeObjects(unittest.TestCase):
|
|
|
420
420
|
fname = 'temp_test_pg_largeobj_export.txt'
|
|
421
421
|
f = open(fname, 'wb') # noqa: SIM115
|
|
422
422
|
else:
|
|
423
|
-
f = tempfile.NamedTemporaryFile()
|
|
423
|
+
f = tempfile.NamedTemporaryFile() # noqa: SIM115
|
|
424
424
|
fname = f.name
|
|
425
425
|
data = b'some data to be exported'
|
|
426
426
|
self.obj.open(pg.INV_WRITE)
|
|
@@ -441,12 +441,11 @@ class TestLargeObjects(unittest.TestCase):
|
|
|
441
441
|
|
|
442
442
|
def test_export_in_existent(self):
|
|
443
443
|
export = self.obj.export
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
f.close()
|
|
444
|
+
with tempfile.NamedTemporaryFile() as f:
|
|
445
|
+
self.obj.open(pg.INV_WRITE)
|
|
446
|
+
self.obj.close()
|
|
447
|
+
self.pgcnx.query(f'select lo_unlink({self.obj.oid})')
|
|
448
|
+
self.assertRaises(IOError, export, f.name)
|
|
450
449
|
|
|
451
450
|
|
|
452
451
|
if __name__ == '__main__':
|
|
@@ -161,7 +161,7 @@ class TestPgDb(dbapi20.DatabaseAPI20Test):
|
|
|
161
161
|
|
|
162
162
|
class TestCursor(pgdb.Cursor):
|
|
163
163
|
|
|
164
|
-
def row_factory(self, row):
|
|
164
|
+
def row_factory(self, row): # type: ignore[override]
|
|
165
165
|
description = self.description
|
|
166
166
|
assert isinstance(description, list)
|
|
167
167
|
return {f'column {desc[0]}': value
|
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
# config file for tox
|
|
2
2
|
|
|
3
3
|
[tox]
|
|
4
|
-
envlist = py3{7,8,9,10,11,12},ruff,mypy,cformat,docs
|
|
4
|
+
envlist = py3{7,8,9,10,11,12,13},ruff,mypy,cformat,docs
|
|
5
|
+
requires = # this is needed for compatibility with Python 3.7
|
|
6
|
+
pip<24.1
|
|
7
|
+
virtualenv<20.27
|
|
5
8
|
|
|
6
9
|
[testenv:ruff]
|
|
7
|
-
basepython = python3.
|
|
8
|
-
deps = ruff>=0.
|
|
10
|
+
basepython = python3.13
|
|
11
|
+
deps = ruff>=0.8,<0.9
|
|
9
12
|
commands =
|
|
10
13
|
ruff check setup.py pg pgdb tests
|
|
11
14
|
|
|
12
15
|
[testenv:mypy]
|
|
13
|
-
basepython = python3.
|
|
14
|
-
deps = mypy>=1.
|
|
16
|
+
basepython = python3.13
|
|
17
|
+
deps = mypy>=1.13,<1.14
|
|
15
18
|
commands =
|
|
16
19
|
mypy pg pgdb tests
|
|
17
20
|
|
|
18
21
|
[testenv:cformat]
|
|
19
|
-
basepython = python3.
|
|
22
|
+
basepython = python3.13
|
|
20
23
|
allowlist_externals =
|
|
21
24
|
sh
|
|
22
25
|
commands =
|
|
23
26
|
sh -c "! (clang-format --style=file -n ext/*.c 2>&1 | tee /dev/tty | grep format-violations)"
|
|
24
27
|
|
|
25
28
|
[testenv:docs]
|
|
26
|
-
basepython = python3.
|
|
29
|
+
basepython = python3.13
|
|
27
30
|
deps =
|
|
28
|
-
sphinx>=
|
|
31
|
+
sphinx>=8,<9
|
|
29
32
|
commands =
|
|
30
33
|
sphinx-build -b html -nEW docs docs/_build/html
|
|
31
34
|
|
|
32
35
|
[testenv:build]
|
|
33
|
-
basepython = python3.
|
|
36
|
+
basepython = python3.13
|
|
34
37
|
deps =
|
|
35
38
|
setuptools>=68
|
|
36
39
|
wheel>=0.42,<1
|
|
@@ -39,11 +42,11 @@ commands =
|
|
|
39
42
|
python -m build -s -n -C strict -C memory-size
|
|
40
43
|
|
|
41
44
|
[testenv:coverage]
|
|
42
|
-
basepython = python3.
|
|
45
|
+
basepython = python3.13
|
|
43
46
|
deps =
|
|
44
47
|
coverage>=7,<8
|
|
45
48
|
commands =
|
|
46
|
-
coverage run -m unittest discover
|
|
49
|
+
coverage run -m unittest discover -v
|
|
47
50
|
coverage html
|
|
48
51
|
|
|
49
52
|
[testenv]
|
|
@@ -54,4 +57,4 @@ deps =
|
|
|
54
57
|
setuptools>=68
|
|
55
58
|
commands =
|
|
56
59
|
python setup.py clean --all build_ext --force --inplace --strict --memory-size
|
|
57
|
-
python -m unittest {posargs:discover}
|
|
60
|
+
python -m unittest {posargs:discover -v}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|