PyGreSQL 6.0b1__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.
Files changed (101) hide show
  1. {PyGreSQL-6.0b1 → pygresql-6.1.0}/LICENSE.txt +1 -1
  2. {PyGreSQL-6.0b1 → pygresql-6.1.0}/PKG-INFO +13 -12
  3. {PyGreSQL-6.0b1 → pygresql-6.1.0}/PyGreSQL.egg-info/PKG-INFO +13 -12
  4. {PyGreSQL-6.0b1 → pygresql-6.1.0}/README.rst +2 -2
  5. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/about.rst +3 -3
  6. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/conf.py +10 -2
  7. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/changelog.rst +14 -0
  8. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/install.rst +1 -1
  9. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/db_wrapper.rst +1 -1
  10. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/copyright.rst +1 -1
  11. {PyGreSQL-6.0b1 → pygresql-6.1.0}/ext/pgconn.c +1 -1
  12. {PyGreSQL-6.0b1 → pygresql-6.1.0}/ext/pginternal.c +1 -1
  13. {PyGreSQL-6.0b1 → pygresql-6.1.0}/ext/pglarge.c +1 -1
  14. {PyGreSQL-6.0b1 → pygresql-6.1.0}/ext/pgmodule.c +1 -1
  15. {PyGreSQL-6.0b1 → pygresql-6.1.0}/ext/pgnotice.c +1 -1
  16. {PyGreSQL-6.0b1 → pygresql-6.1.0}/ext/pgquery.c +1 -1
  17. {PyGreSQL-6.0b1 → pygresql-6.1.0}/ext/pgsource.c +1 -1
  18. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/__init__.py +81 -29
  19. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/adapt.py +9 -3
  20. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/cast.py +14 -4
  21. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/core.py +68 -24
  22. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/db.py +9 -6
  23. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/error.py +6 -1
  24. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/helpers.py +8 -2
  25. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pgdb/__init__.py +57 -16
  26. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pgdb/adapt.py +31 -7
  27. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pgdb/cast.py +18 -5
  28. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pyproject.toml +27 -23
  29. {PyGreSQL-6.0b1 → pygresql-6.1.0}/setup.py +23 -5
  30. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_classic_connection.py +11 -10
  31. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_classic_dbwrapper.py +14 -5
  32. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_classic_functions.py +2 -2
  33. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_classic_largeobj.py +7 -8
  34. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_dbapi20.py +1 -1
  35. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tox.ini +20 -15
  36. {PyGreSQL-6.0b1 → pygresql-6.1.0}/MANIFEST.in +0 -0
  37. {PyGreSQL-6.0b1 → pygresql-6.1.0}/PyGreSQL.egg-info/SOURCES.txt +0 -0
  38. {PyGreSQL-6.0b1 → pygresql-6.1.0}/PyGreSQL.egg-info/dependency_links.txt +0 -0
  39. {PyGreSQL-6.0b1 → pygresql-6.1.0}/PyGreSQL.egg-info/not-zip-safe +0 -0
  40. {PyGreSQL-6.0b1 → pygresql-6.1.0}/PyGreSQL.egg-info/top_level.txt +0 -0
  41. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/Makefile +0 -0
  42. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/_static/favicon.ico +0 -0
  43. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/_static/pygresql.png +0 -0
  44. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/community/homes.rst +0 -0
  45. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/community/index.rst +0 -0
  46. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/community/issues.rst +0 -0
  47. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/community/mailinglist.rst +0 -0
  48. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/community/source.rst +0 -0
  49. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/community/support.rst +0 -0
  50. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/examples.rst +0 -0
  51. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/general.rst +0 -0
  52. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/index.rst +0 -0
  53. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/adaptation.rst +0 -0
  54. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/connection.rst +0 -0
  55. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/db_types.rst +0 -0
  56. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/index.rst +0 -0
  57. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/introduction.rst +0 -0
  58. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/large_objects.rst +0 -0
  59. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/module.rst +0 -0
  60. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/notification.rst +0 -0
  61. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pg/query.rst +0 -0
  62. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pgdb/adaptation.rst +0 -0
  63. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pgdb/connection.rst +0 -0
  64. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pgdb/cursor.rst +0 -0
  65. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pgdb/index.rst +0 -0
  66. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pgdb/introduction.rst +0 -0
  67. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pgdb/module.rst +0 -0
  68. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pgdb/typecache.rst +0 -0
  69. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/pgdb/types.rst +0 -0
  70. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/postgres/advanced.rst +0 -0
  71. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/postgres/basic.rst +0 -0
  72. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/postgres/func.rst +0 -0
  73. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/postgres/index.rst +0 -0
  74. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/postgres/syscat.rst +0 -0
  75. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/contents/tutorial.rst +0 -0
  76. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/download/download.rst +0 -0
  77. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/download/files.rst +0 -0
  78. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/download/index.rst +0 -0
  79. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/make.bat +0 -0
  80. {PyGreSQL-6.0b1 → pygresql-6.1.0}/docs/requirements.txt +0 -0
  81. {PyGreSQL-6.0b1 → pygresql-6.1.0}/ext/pgtypes.h +0 -0
  82. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/_pg.pyi +0 -0
  83. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/attrs.py +0 -0
  84. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/notify.py +0 -0
  85. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/py.typed +0 -0
  86. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pg/tz.py +0 -0
  87. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pgdb/connect.py +0 -0
  88. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pgdb/connection.py +0 -0
  89. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pgdb/constants.py +0 -0
  90. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pgdb/cursor.py +0 -0
  91. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pgdb/py.typed +0 -0
  92. {PyGreSQL-6.0b1 → pygresql-6.1.0}/pgdb/typecode.py +0 -0
  93. {PyGreSQL-6.0b1 → pygresql-6.1.0}/setup.cfg +0 -0
  94. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/__init__.py +0 -0
  95. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/config.py +0 -0
  96. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/dbapi20.py +0 -0
  97. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_classic.py +0 -0
  98. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_classic_attrdict.py +0 -0
  99. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_classic_notification.py +0 -0
  100. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_dbapi20_copy.py +0 -0
  101. {PyGreSQL-6.0b1 → pygresql-6.1.0}/tests/test_tutorial.py +0 -0
@@ -6,7 +6,7 @@ Copyright (c) 1995, Pascal Andre
6
6
 
7
7
  Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
8
8
 
9
- Further modifications copyright (c) 2009-2023 by the PyGreSQL Development Team
9
+ Further modifications copyright (c) 2009-2024 by the PyGreSQL Development Team
10
10
 
11
11
  PyGreSQL is released under the PostgreSQL License, a liberal Open Source
12
12
  license, similar to the BSD or MIT licenses:
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyGreSQL
3
- Version: 6.0b1
3
+ Version: 6.1.0
4
4
  Summary: Python PostgreSQL interfaces
5
5
  Home-page: https://pygresql.github.io/
6
- Download-URL: https://pygresql.github.io/contents/download/
6
+ Download-URL: https://pygresql.github.io/download/
7
7
  Author: D'Arcy J. M. Cain
8
8
  Author-email: "D'Arcy J. M. Cain" <darcy@pygresql.org>, Christoph Zwerschke <cito@online.de>
9
9
  License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
@@ -14,7 +14,7 @@ License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
14
14
 
15
15
  Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
16
16
 
17
- Further modifications copyright (c) 2009-2023 by the PyGreSQL Development Team
17
+ Further modifications copyright (c) 2009-2024 by the PyGreSQL Development Team
18
18
 
19
19
  PyGreSQL is released under the PostgreSQL License, a liberal Open Source
20
20
  license, similar to the BSD or MIT licenses:
@@ -37,13 +37,13 @@ License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
37
37
  AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
38
38
  ENHANCEMENTS, OR MODIFICATIONS.
39
39
 
40
- Project-URL: homepage, https://pygresql.github.io/
41
- Project-URL: documentation, https://pygresql.github.io/contents/
42
- Project-URL: source, https://github.com/PyGreSQL/PyGreSQL
43
- Project-URL: issues, https://github.com/PyGreSQL/PyGreSQL/issues/
44
- Project-URL: changelog, https://pygresql.github.io/contents/changelog.html
45
- Project-URL: download, https://pygresql.github.io/download/
46
- Project-URL: mailing list, https://mail.vex.net/mailman/listinfo/pygresql
40
+ Project-URL: Homepage, https://pygresql.github.io/
41
+ Project-URL: Documentation, https://pygresql.github.io/contents/
42
+ Project-URL: Source Code, https://github.com/PyGreSQL/PyGreSQL
43
+ Project-URL: Issue Tracker, https://github.com/PyGreSQL/PyGreSQL/issues/
44
+ Project-URL: Changelog, https://pygresql.github.io/contents/changelog.html
45
+ Project-URL: Download, https://pygresql.github.io/download/
46
+ Project-URL: Mailing List, https://mail.vex.net/mailman/listinfo/pygresql
47
47
  Keywords: pygresql,postgresql,database,api,dbapi
48
48
  Classifier: Development Status :: 6 - Mature
49
49
  Classifier: Intended Audience :: Developers
@@ -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.12
90
- and PostgreSQL versions 10 to 16 on the server.
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,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyGreSQL
3
- Version: 6.0b1
3
+ Version: 6.1.0
4
4
  Summary: Python PostgreSQL interfaces
5
5
  Home-page: https://pygresql.github.io/
6
- Download-URL: https://pygresql.github.io/contents/download/
6
+ Download-URL: https://pygresql.github.io/download/
7
7
  Author: D'Arcy J. M. Cain
8
8
  Author-email: "D'Arcy J. M. Cain" <darcy@pygresql.org>, Christoph Zwerschke <cito@online.de>
9
9
  License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
@@ -14,7 +14,7 @@ License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
14
14
 
15
15
  Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
16
16
 
17
- Further modifications copyright (c) 2009-2023 by the PyGreSQL Development Team
17
+ Further modifications copyright (c) 2009-2024 by the PyGreSQL Development Team
18
18
 
19
19
  PyGreSQL is released under the PostgreSQL License, a liberal Open Source
20
20
  license, similar to the BSD or MIT licenses:
@@ -37,13 +37,13 @@ License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
37
37
  AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
38
38
  ENHANCEMENTS, OR MODIFICATIONS.
39
39
 
40
- Project-URL: homepage, https://pygresql.github.io/
41
- Project-URL: documentation, https://pygresql.github.io/contents/
42
- Project-URL: source, https://github.com/PyGreSQL/PyGreSQL
43
- Project-URL: issues, https://github.com/PyGreSQL/PyGreSQL/issues/
44
- Project-URL: changelog, https://pygresql.github.io/contents/changelog.html
45
- Project-URL: download, https://pygresql.github.io/download/
46
- Project-URL: mailing list, https://mail.vex.net/mailman/listinfo/pygresql
40
+ Project-URL: Homepage, https://pygresql.github.io/
41
+ Project-URL: Documentation, https://pygresql.github.io/contents/
42
+ Project-URL: Source Code, https://github.com/PyGreSQL/PyGreSQL
43
+ Project-URL: Issue Tracker, https://github.com/PyGreSQL/PyGreSQL/issues/
44
+ Project-URL: Changelog, https://pygresql.github.io/contents/changelog.html
45
+ Project-URL: Download, https://pygresql.github.io/download/
46
+ Project-URL: Mailing List, https://mail.vex.net/mailman/listinfo/pygresql
47
47
  Keywords: pygresql,postgresql,database,api,dbapi
48
48
  Classifier: Development Status :: 6 - Mature
49
49
  Classifier: Intended Audience :: Developers
@@ -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.12
90
- and PostgreSQL versions 10 to 16 on the server.
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.12
22
- and PostgreSQL versions 10 to 16 on the server.
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
  ------------
@@ -8,7 +8,7 @@ powerful PostgreSQL features from Python.
8
8
 
9
9
  | This software is copyright © 1995, Pascal Andre.
10
10
  | Further modifications are copyright © 1997-2008 by D'Arcy J.M. Cain.
11
- | Further modifications are copyright © 2009-2023 by the PyGreSQL team.
11
+ | Further modifications are copyright © 2009-2024 by the PyGreSQL team.
12
12
  | For licensing details, see the full :doc:`copyright`.
13
13
 
14
14
  **PostgreSQL** is a highly scalable, SQL compliant, open source
@@ -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 16, and Python
43
- 3.7 to 3.12. If you need to support older PostgreSQL or Python versions,
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.
@@ -8,9 +8,17 @@
8
8
 
9
9
  project = 'PyGreSQL'
10
10
  author = 'The PyGreSQL team'
11
- copyright = '2023, ' + author
11
+ copyright = '2024, ' + author
12
12
 
13
- version = release = '6.0b1'
13
+ def project_version():
14
+ with open('../pyproject.toml') as f:
15
+ for d in f:
16
+ if d.startswith("version ="):
17
+ version = d.split("=")[1].strip().strip('"')
18
+ return version
19
+ raise Exception("Cannot determine PyGreSQL version")
20
+
21
+ version = release = project_version()
14
22
 
15
23
  language = 'en'
16
24
 
@@ -1,6 +1,20 @@
1
1
  ChangeLog
2
2
  =========
3
3
 
4
+ Version 6.1.0 (2024-12-05)
5
+ --------------------------
6
+ - Support Python 3.13 and PostgreSQL 17.
7
+
8
+ Version 6.0.1 (2024-04-19)
9
+ --------------------------
10
+ - Properly adapt falsy JSON values (#86)
11
+
12
+ Version 6.0 (2023-10-03)
13
+ ------------------------
14
+ - Tested with the recent releases of Python 3.12 and PostgreSQL 16.
15
+ - Make pyproject.toml the only source of truth for the version number.
16
+ - Please also note the changes already made in version 6.0b1.
17
+
4
18
  Version 6.0b1 (2023-09-06)
5
19
  --------------------------
6
20
  - Officially support Python 3.12 and PostgreSQL 16 (tested with rc versions).
@@ -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.12, and PostgreSQL versions 10 to 16.
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 d: optional dictionary of values
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,
@@ -10,7 +10,7 @@ Copyright (c) 1995, Pascal Andre
10
10
  Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
11
11
  (darcy@PyGreSQL.org)
12
12
 
13
- Further modifications copyright (c) 2009-2023 by the PyGreSQL team.
13
+ Further modifications copyright (c) 2009-2024 by the PyGreSQL team.
14
14
 
15
15
  Permission to use, copy, modify, and distribute this software and its
16
16
  documentation for any purpose, without fee, and without a written agreement
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The connection object - this file is part a of the C extension module.
5
5
  *
6
- * Copyright (c) 2023 by the PyGreSQL Development Team
6
+ * Copyright (c) 2024 by the PyGreSQL Development Team
7
7
  *
8
8
  * Please see the LICENSE.TXT file for specific restrictions.
9
9
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Internal functions - this file is part a of the C extension module.
5
5
  *
6
- * Copyright (c) 2023 by the PyGreSQL Development Team
6
+ * Copyright (c) 2024 by the PyGreSQL Development Team
7
7
  *
8
8
  * Please see the LICENSE.TXT file for specific restrictions.
9
9
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Large object support - this file is part a of the C extension module.
5
5
  *
6
- * Copyright (c) 2023 by the PyGreSQL Development Team
6
+ * Copyright (c) 2024 by the PyGreSQL Development Team
7
7
  *
8
8
  * Please see the LICENSE.TXT file for specific restrictions.
9
9
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * This is the main file for the C extension module.
5
5
  *
6
- * Copyright (c) 2023 by the PyGreSQL Development Team
6
+ * Copyright (c) 2024 by the PyGreSQL Development Team
7
7
  *
8
8
  * Please see the LICENSE.TXT file for specific restrictions.
9
9
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The notice object - this file is part a of the C extension module.
5
5
  *
6
- * Copyright (c) 2023 by the PyGreSQL Development Team
6
+ * Copyright (c) 2024 by the PyGreSQL Development Team
7
7
  *
8
8
  * Please see the LICENSE.TXT file for specific restrictions.
9
9
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The query object - this file is part a of the C extension module.
5
5
  *
6
- * Copyright (c) 2023 by the PyGreSQL Development Team
6
+ * Copyright (c) 2024 by the PyGreSQL Development Team
7
7
  *
8
8
  * Please see the LICENSE.TXT file for specific restrictions.
9
9
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The source object - this file is part a of the C extension module.
5
5
  *
6
- * Copyright (c) 2023 by the PyGreSQL Development Team
6
+ * Copyright (c) 2024 by the PyGreSQL Development Team
7
7
  *
8
8
  * Please see the LICENSE.TXT file for specific restrictions.
9
9
  */
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # This file contains the classic pg module.
6
6
  #
7
- # Copyright (c) 2023 by the PyGreSQL Development Team
7
+ # Copyright (c) 2024 by the PyGreSQL Development Team
8
8
  #
9
9
  # The notification handler is based on pgnotify which is
10
10
  # Copyright (c) 2001 Ng Pheng Siong. All rights reserved.
@@ -99,34 +99,86 @@ from .helpers import RowCache, init_core
99
99
  from .notify import NotificationHandler
100
100
 
101
101
  __all__ = [
102
- 'DB', 'Adapter',
103
- 'NotificationHandler', 'Typecasts',
104
- 'Bytea', 'Hstore', 'Json', 'Literal',
105
- 'Error', 'Warning',
106
- 'DataError', 'DatabaseError',
107
- 'IntegrityError', 'InterfaceError', 'InternalError',
108
- 'InvalidResultError', 'MultipleResultsError',
109
- 'NoResultError', 'NotSupportedError',
110
- 'OperationalError', 'ProgrammingError',
111
- 'Connection', 'Query', 'RowCache',
112
- 'INV_READ', 'INV_WRITE',
113
- 'POLLING_OK', 'POLLING_FAILED', 'POLLING_READING', 'POLLING_WRITING',
114
- 'RESULT_DDL', 'RESULT_DML', 'RESULT_DQL', 'RESULT_EMPTY',
115
- 'SEEK_CUR', 'SEEK_END', 'SEEK_SET',
116
- 'TRANS_ACTIVE', 'TRANS_IDLE', 'TRANS_INERROR',
117
- 'TRANS_INTRANS', 'TRANS_UNKNOWN',
118
- 'cast_array', 'cast_hstore', 'cast_record',
119
- 'connect', 'escape_bytea', 'escape_string', 'unescape_bytea',
120
- 'get_array', 'get_bool', 'get_bytea_escaped',
121
- 'get_datestyle', 'get_decimal', 'get_decimal_point',
122
- 'get_defbase', 'get_defhost', 'get_defopt', 'get_defport', 'get_defuser',
123
- 'get_jsondecode', 'get_pqlib_version', 'get_typecast',
124
- 'set_array', 'set_bool', 'set_bytea_escaped',
125
- 'set_datestyle', 'set_decimal', 'set_decimal_point',
126
- 'set_defbase', 'set_defhost', 'set_defopt',
127
- 'set_defpasswd', 'set_defport', 'set_defuser',
128
- 'set_jsondecode', 'set_query_helpers', 'set_typecast',
129
- 'version', '__version__',
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
- 'Adapter', 'Bytea', 'DbType', 'DbTypes',
25
- 'Hstore', 'Literal', 'Json', 'UUID'
24
+ 'UUID',
25
+ 'Adapter',
26
+ 'Bytea',
27
+ 'DbType',
28
+ 'DbTypes',
29
+ 'Hstore',
30
+ 'Json',
31
+ 'Literal'
26
32
  ]
27
33
 
28
34
 
@@ -333,7 +339,7 @@ class Adapter:
333
339
 
334
340
  def _adapt_json(self, v: Any) -> str | None:
335
341
  """Adapt a json parameter."""
336
- if not v:
342
+ if v is None:
337
343
  return None
338
344
  if isinstance(v, str):
339
345
  return v
@@ -25,10 +25,20 @@ from .core import (
25
25
  from .tz import timezone_as_offset
26
26
 
27
27
  __all__ = [
28
- 'cast_bool', 'cast_json', 'cast_num', 'cast_money', 'cast_int2vector',
29
- 'cast_date', 'cast_time', 'cast_timetz', 'cast_interval',
30
- 'cast_timestamp','cast_timestamptz',
31
- 'Typecasts', 'get_typecast', 'set_typecast'
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
- 'Error', 'Warning',
112
- 'DataError', 'DatabaseError',
113
- 'IntegrityError', 'InterfaceError', 'InternalError',
114
- 'InvalidResultError', 'MultipleResultsError',
115
- 'NoResultError', 'NotSupportedError',
116
- 'OperationalError', 'ProgrammingError',
117
- 'Connection', 'Query', 'LargeObject',
118
- 'INV_READ', 'INV_WRITE',
119
- 'POLLING_OK', 'POLLING_FAILED', 'POLLING_READING', 'POLLING_WRITING',
120
- 'RESULT_DDL', 'RESULT_DML', 'RESULT_DQL', 'RESULT_EMPTY',
121
- 'SEEK_CUR', 'SEEK_END', 'SEEK_SET',
122
- 'TRANS_ACTIVE', 'TRANS_IDLE', 'TRANS_INERROR',
123
- 'TRANS_INTRANS', 'TRANS_UNKNOWN',
124
- 'cast_array', 'cast_hstore', 'cast_record',
125
- 'connect', 'escape_bytea', 'escape_string', 'unescape_bytea',
126
- 'get_array', 'get_bool', 'get_bytea_escaped',
127
- 'get_datestyle', 'get_decimal', 'get_decimal_point',
128
- 'get_defbase', 'get_defhost', 'get_defopt', 'get_defport', 'get_defuser',
129
- 'get_jsondecode', 'get_pqlib_version',
130
- 'set_array', 'set_bool', 'set_bytea_escaped',
131
- 'set_datestyle', 'set_decimal', 'set_decimal_point',
132
- 'set_defbase', 'set_defhost', 'set_defopt',
133
- 'set_defpasswd', 'set_defport', 'set_defuser',
134
- 'set_jsondecode', 'set_query_helpers',
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
  ]
@@ -802,8 +802,9 @@ class DB:
802
802
  adapt = params.add
803
803
  col = self.escape_identifier
804
804
  what = 'oid, *' if qoid else '*'
805
- where = ' AND '.join('{} OPERATOR(pg_catalog.=) {}'.format(
806
- col(k), adapt(row[k], attnames[k])) for k in keyname)
805
+ where = ' AND '.join(
806
+ f'{col(k)} OPERATOR(pg_catalog.=) {adapt(row[k], attnames[k])}'
807
+ for k in keyname)
807
808
  if 'oid' in row:
808
809
  if qoid:
809
810
  row[qoid] = row['oid']
@@ -913,8 +914,9 @@ class DB:
913
914
  params = self.adapter.parameter_list()
914
915
  adapt = params.add
915
916
  col = self.escape_identifier
916
- where = ' AND '.join('{} OPERATOR(pg_catalog.=) {}'.format(
917
- col(k), adapt(row[k], attnames[k])) for k in keynames)
917
+ where = ' AND '.join(
918
+ f'{col(k)} OPERATOR(pg_catalog.=) {adapt(row[k], attnames[k])}'
919
+ for k in keynames)
918
920
  if 'oid' in row:
919
921
  if qoid:
920
922
  row[qoid] = row['oid']
@@ -1103,8 +1105,9 @@ class DB:
1103
1105
  params = self.adapter.parameter_list()
1104
1106
  adapt = params.add
1105
1107
  col = self.escape_identifier
1106
- where = ' AND '.join('{} OPERATOR(pg_catalog.=) {}'.format(
1107
- col(k), adapt(row[k], attnames[k])) for k in keynames)
1108
+ where = ' AND '.join(
1109
+ f'{col(k)} OPERATOR(pg_catalog.=) {adapt(row[k], attnames[k])}'
1110
+ for k in keynames)
1108
1111
  if 'oid' in row:
1109
1112
  if qoid:
1110
1113
  row[qoid] = row['oid']
@@ -14,7 +14,12 @@ from .core import (
14
14
  )
15
15
 
16
16
  __all__ = [
17
- 'error', 'db_error', 'if_error', 'int_error', 'op_error', 'prg_error'
17
+ 'db_error',
18
+ 'error',
19
+ 'if_error',
20
+ 'int_error',
21
+ 'op_error',
22
+ 'prg_error'
18
23
  ]
19
24
 
20
25
  # Error messages
@@ -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
- 'quote_if_unqualified', 'oid_key', 'QuoteDict', 'RowCache',
17
- 'dictiter', 'namediter', 'namednext', 'scalariter'
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