diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index defe9d7a..f562ae32 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,13 +17,13 @@ jobs: # job. strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0-rc.1] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] os: [ubuntu-latest, macos-latest, windows-latest] loop: [asyncio, uvloop] exclude: # uvloop does not support Python 3.6 - loop: uvloop - python-version: 3.6 + python-version: "3.6" # uvloop does not support windows - loop: uvloop os: windows-latest @@ -79,7 +79,7 @@ jobs: test-postgres: strategy: matrix: - postgres-version: [9.5, 9.6, 10, 11, 12, 13] + postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14"] runs-on: ubuntu-latest diff --git a/README.rst b/README.rst index 2f5da7a4..2ed14726 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ framework. You can read more about asyncpg in an introductory `blog post `_. asyncpg requires Python 3.6 or later and is supported for PostgreSQL -versions 9.5 to 13. Older PostgreSQL versions or other databases implementing +versions 9.5 to 14. Older PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. diff --git a/asyncpg/exceptions/__init__.py b/asyncpg/exceptions/__init__.py index af46a754..c5b5ccc4 100644 --- a/asyncpg/exceptions/__init__.py +++ b/asyncpg/exceptions/__init__.py @@ -337,6 +337,10 @@ class DuplicateJsonObjectKeyValueError(DataError): sqlstate = '22030' +class InvalidArgumentForSQLJsonDatetimeFunctionError(DataError): + sqlstate = '22031' + + class InvalidJsonTextError(DataError): sqlstate = '22032' @@ -872,6 +876,10 @@ class DatabaseDroppedError(OperatorInterventionError): sqlstate = '57P04' +class IdleSessionTimeoutError(OperatorInterventionError): + sqlstate = '57P05' + + class PostgresSystemError(_base.PostgresError): sqlstate = '58000' @@ -1086,8 +1094,8 @@ class IndexCorruptedError(InternalServerError): 'ForeignKeyViolationError', 'FunctionExecutedNoReturnStatementError', 'GeneratedAlwaysError', 'GroupingError', 'HeldCursorRequiresSameIsolationLevelError', - 'IdleInTransactionSessionTimeoutError', 'ImplicitZeroBitPadding', - 'InFailedSQLTransactionError', + 'IdleInTransactionSessionTimeoutError', 'IdleSessionTimeoutError', + 'ImplicitZeroBitPadding', 'InFailedSQLTransactionError', 'InappropriateAccessModeForBranchTransactionError', 'InappropriateIsolationLevelForBranchTransactionError', 'IndeterminateCollationError', 'IndeterminateDatatypeError', @@ -1098,6 +1106,7 @@ class IndexCorruptedError(InternalServerError): 'InvalidArgumentForNthValueFunctionError', 'InvalidArgumentForNtileFunctionError', 'InvalidArgumentForPowerFunctionError', + 'InvalidArgumentForSQLJsonDatetimeFunctionError', 'InvalidArgumentForWidthBucketFunctionError', 'InvalidAuthorizationSpecificationError', 'InvalidBinaryRepresentationError', 'InvalidCachedStatementError', diff --git a/docs/index.rst b/docs/index.rst index 57031b03..87c43aa8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,7 +15,8 @@ of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. **asyncpg** requires Python 3.6 or later and is supported for PostgreSQL -versions 9.5 to 13. +versions 9.5 to 14. Older PostgreSQL versions or other databases implementing +the PostgreSQL protocol *may* work, but are not being actively tested. Contents -------- diff --git a/tools/generate_exceptions.py b/tools/generate_exceptions.py index 2e7477c3..0b626558 100755 --- a/tools/generate_exceptions.py +++ b/tools/generate_exceptions.py @@ -176,9 +176,11 @@ def _add_class(clsname, base, sqlstate, docstring): buf += '\n\n\n'.join(classes) _all = textwrap.wrap(', '.join('{!r}'.format(c) for c in sorted(clsnames))) - buf += '\n\n\n__all__ = _base.__all__ + (\n {}\n)'.format( + buf += '\n\n\n__all__ = (\n {}\n)'.format( '\n '.join(_all)) + buf += '\n\n__all__ += _base.__all__' + print(buf)