Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ jobs:
fail-fast: false
matrix:
crdb-version: [
"cockroach:latest-v23.2",
"cockroach:latest-v24.1",
"cockroach:latest-v24.2"
"cockroach:latest-v24.2",
"cockroach:latest-v24.3"
]
db-alias: [
"psycopg2",
Expand Down Expand Up @@ -84,4 +84,3 @@ jobs:
run: pip install --user tox==${TOX_VERSION}
- name: Lint
run: ${HOME}/.local/bin/tox -e lint

4 changes: 0 additions & 4 deletions README.asyncpg.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ There is a customized version of the FastAPI SQL database tutorial for

https://github.com/gordthompson/fastapi-tutorial-cockroachdb-async

### Database support for Alembic

CockroachDB version 23.1 or later is required to work with Alembic.

### Testing

Assuming that you have an entry in test.cfg that looks something like
Expand Down
37 changes: 0 additions & 37 deletions README.read_committed.md

This file was deleted.

41 changes: 22 additions & 19 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
backports-tarfile==1.2.0
# via jaraco-context
certifi==2024.8.30
certifi==2025.1.31
# via requests
cffi==1.17.1
# via cryptography
charset-normalizer==3.4.0
charset-normalizer==3.4.1
# via requests
cryptography==43.0.1
cryptography==44.0.0
# via secretstorage
distlib==0.3.9
# via virtualenv
docutils==0.21.2
# via readme-renderer
filelock==3.16.1
filelock==3.17.0
# via
# tox
# virtualenv
id==1.5.0
# via twine
idna==3.10
# via requests
importlib-metadata==8.5.0
importlib-metadata==8.6.1
# via
# keyring
# twine
Expand All @@ -32,22 +34,22 @@ jeepney==0.8.0
# via
# keyring
# secretstorage
keyring==25.4.1
keyring==25.6.0
# via twine
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.5.0
more-itertools==10.6.0
# via
# jaraco-classes
# jaraco-functools
nh3==0.2.18
nh3==0.2.20
# via readme-renderer
packaging==24.1
# via tox
pkginfo==1.10.0
# via twine
packaging==24.2
# via
# tox
# twine
platformdirs==4.3.6
# via virtualenv
pluggy==1.5.0
Expand All @@ -56,39 +58,40 @@ py==1.11.0
# via tox
pycparser==2.22
# via cffi
pygments==2.18.0
pygments==2.19.1
# via
# readme-renderer
# rich
readme-renderer==44.0
# via twine
requests==2.32.3
# via
# id
# requests-toolbelt
# twine
requests-toolbelt==1.0.0
# via twine
rfc3986==2.0.0
# via twine
rich==13.9.2
rich==13.9.4
# via twine
secretstorage==3.3.3
# via keyring
six==1.16.0
six==1.17.0
# via tox
toml==0.10.2
# via tox
tox==3.23.1
# via -r dev-requirements.in
twine==5.1.1
twine==6.1.0
# via -r dev-requirements.in
typing-extensions==4.12.2
# via rich
urllib3==2.2.3
urllib3==2.3.0
# via
# requests
# twine
virtualenv==20.26.6
virtualenv==20.29.1
# via tox
zipp==3.20.2
zipp==3.21.0
# via importlib-metadata
24 changes: 12 additions & 12 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
alembic==1.13.3
alembic==1.14.1
# via -r test-requirements.in
async-timeout==4.0.3
async-timeout==5.0.1
# via asyncpg
asyncpg==0.29.0
asyncpg==0.30.0
# via -r test-requirements.in
attrs==24.2.0
attrs==25.1.0
# via pytest
futures==3.0.5
# via -r test-requirements.in
greenlet==3.1.1
# via sqlalchemy
iniconfig==2.0.0
# via pytest
mako==1.3.5
mako==1.3.9
# via alembic
markupsafe==3.0.1
markupsafe==3.0.2
# via mako
mock==5.1.0
# via -r test-requirements.in
more-itertools==10.5.0
more-itertools==10.6.0
# via -r test-requirements.in
packaging==24.1
packaging==24.2
# via pytest
pluggy==1.5.0
# via pytest
psycopg==3.2.3
psycopg==3.2.4
# via -r test-requirements.in
psycopg2==2.9.9
psycopg2==2.9.10
# via -r test-requirements.in
py==1.11.0
# via pytest
pytest==7.1.3
# via -r test-requirements.in
sqlalchemy==2.0.36
sqlalchemy==2.0.38
# via
# -r test-requirements.in
# alembic
tomli==2.0.2
tomli==2.2.1
# via pytest
typing-extensions==4.12.2
# via
Expand Down
44 changes: 20 additions & 24 deletions test/test_suite_sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
)
from sqlalchemy.testing.suite import HasIndexTest as _HasIndexTest
from sqlalchemy.testing.suite import HasTableTest as _HasTableTest
from sqlalchemy.testing.suite import IntegerTest as _IntegerTest
from sqlalchemy.testing.suite import InsertBehaviorTest as _InsertBehaviorTest
from sqlalchemy.testing.suite import IsolationLevelTest as _IsolationLevelTest
from sqlalchemy.testing.suite import (
Expand Down Expand Up @@ -417,24 +418,19 @@ def test_no_results_for_non_returning_insert(self):
pass


class IsolationLevelTest(_IsolationLevelTest):
def test_all_levels(self):
if not config.db.dialect._is_v232plus:
# TODO: enable when READ COMMITTED no longer a preview feature, since
# SET CLUSTER SETTING cannot be used inside a multi-statement transaction
super().test_all_levels()
class IntegerTest(_IntegerTest):
@_IntegerTest._huge_ints()
def test_huge_int(self, integer_round_trip, intvalue):
if config.db.dialect.driver != "asyncpg":
super().test_huge_int(integer_round_trip, intvalue)


class IsolationLevelTest(_IsolationLevelTest):
@skip("cockroachdb")
def test_dialect_user_setting_is_restored(self):
# IndexError: list index out of range
pass

def test_non_default_isolation_level(self):
if not config.db.dialect._is_v232plus:
# TODO: enable when READ COMMITTED no longer a preview feature, since
# SET CLUSTER SETTING cannot be used inside a multi-statement transaction
super().test_non_default_isolation_level()


class LongNameBlowoutTest(_LongNameBlowoutTest):
@testing.combinations(
Expand All @@ -450,6 +446,18 @@ def test_long_convention_name(self, type_, metadata, connection):
super().test_long_convention_name(type_, metadata, connection, None)


class NumericTest(_NumericTest):
def test_numeric_as_float(self, do_numeric_test):
# psycopg.errors.InvalidParameterValue: unsupported binary operator: <decimal> + <float>
if config.db.dialect.driver != "psycopg":
super().test_numeric_as_float(do_numeric_test)

def test_numeric_null_as_float(self, do_numeric_test):
# psycopg.errors.InvalidParameterValue: unsupported binary operator: <decimal> + <float>
if config.db.dialect.driver != "psycopg":
super().test_numeric_null_as_float(do_numeric_test)


class QuotedNameArgumentTest(_QuotedNameArgumentTest):
def quote_fixtures(fn):
return testing.combinations(
Expand All @@ -464,18 +472,6 @@ def test_get_indexes(self, name):
super().test_get_indexes(name, None)


class NumericTest(_NumericTest):
def test_numeric_as_float(self, do_numeric_test):
# psycopg.errors.InvalidParameterValue: unsupported binary operator: <decimal> + <float>
if config.db.dialect.driver != "psycopg":
super().test_numeric_as_float(do_numeric_test)

def test_numeric_null_as_float(self, do_numeric_test):
# psycopg.errors.InvalidParameterValue: unsupported binary operator: <decimal> + <float>
if config.db.dialect.driver != "psycopg":
super().test_numeric_null_as_float(do_numeric_test)


class TrueDivTest(_TrueDivTest):
@skip("cockroachdb")
def test_floordiv_integer(self):
Expand Down