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
618 changes: 618 additions & 0 deletions .check_expression_baseline.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:

- name: Install activerecord and testsuite from git
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@feature/error-taxonomy" # NOSONAR
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/error-taxonomy" # NOSONAR
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30" # NOSONAR
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17" # NOSONAR

- name: Install dependencies
run: |
Expand Down Expand Up @@ -175,8 +175,8 @@ jobs:

- name: Install activerecord and testsuite from git
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@feature/error-taxonomy" # NOSONAR
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/error-taxonomy" # NOSONAR
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30" # NOSONAR
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17" # NOSONAR

- name: Install dependencies
run: |
Expand Down Expand Up @@ -303,8 +303,8 @@ jobs:

- name: Install activerecord and testsuite from git
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@feature/error-taxonomy" # NOSONAR
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/error-taxonomy" # NOSONAR
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30" # NOSONAR
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17" # NOSONAR

- name: Install dependencies
run: |
Expand Down Expand Up @@ -439,8 +439,8 @@ jobs:

- name: Install activerecord and testsuite from git
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@feature/error-taxonomy" # NOSONAR
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/error-taxonomy" # NOSONAR
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30" # NOSONAR
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17" # NOSONAR

- name: Install dependencies
run: |
Expand Down
12 changes: 8 additions & 4 deletions tests/providers/basic_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
from rhosocial.activerecord.backend.impl.oracle.backend import OracleBackend
from rhosocial.activerecord.backend.impl.oracle.backend.async_backend import AsyncOracleBackend
from rhosocial.activerecord.connection.pool import BackendPool, AsyncBackendPool, PoolConfig
from rhosocial.activerecord.backend.options import ExecutionOptions
from rhosocial.activerecord.backend.schema import StatementType

from rhosocial.activerecord.testsuite.feature.basic.connection.interfaces import IBasicConnectionProvider
from .scenarios import get_scenario, get_enabled_scenarios
Expand All @@ -38,7 +36,10 @@
class SyncTestUser(ActiveRecord):
"""Sync test user model for connection pool tests."""

__table_name__ = "test_users"
@classmethod
def table_name(cls):
return "test_users"

id: Optional[int] = None
name: str
email: str
Expand All @@ -47,7 +48,10 @@ class SyncTestUser(ActiveRecord):
class AsyncTestUser(AsyncActiveRecord):
"""Async test user model for connection pool tests."""

__table_name__ = "test_users"
@classmethod
def table_name(cls):
return "test_users"

id: Optional[int] = None
name: str
email: str
Expand Down
10 changes: 8 additions & 2 deletions tests/providers/query_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
class SyncQueryTestUser(ActiveRecord):
"""Sync test user model for query connection pool tests."""

__table_name__ = "test_users"
@classmethod
def table_name(cls):
return "test_users"

id: Optional[int] = None
name: str
email: str
Expand All @@ -44,7 +47,10 @@ class SyncQueryTestUser(ActiveRecord):
class AsyncQueryTestUser(AsyncActiveRecord):
"""Async test user model for query connection pool tests."""

__table_name__ = "test_users"
@classmethod
def table_name(cls):
return "test_users"

id: Optional[int] = None
name: str
email: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@


class AsyncCustomer(AsyncActiveRecord):
__table_name__ = "customers"
__schema_name__ = "ar_crm"
@classmethod
def table_name(cls):
return "customers"

@classmethod
def schema_name(cls):
return "ar_crm"

c: ClassVar[FieldProxy] = FieldProxy()

id: Optional[int] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,13 @@ def table_tablespace(cls):


class SyncModel(DeclarationMixin, ActiveRecord):
__table_name__ = "ddl_source_sync"
__primary_key__ = "id"
@classmethod
def table_name(cls):
return "ddl_source_sync"

@classmethod
def primary_key(cls):
return "id"

pk_field: PK_TYPE
value_field: VALUE_TYPE = DEFAULT_VALUE
Expand All @@ -216,8 +221,13 @@ class SyncModel(DeclarationMixin, ActiveRecord):


class AsyncModel(DeclarationMixin, AsyncActiveRecord):
__table_name__ = "ddl_source_async"
__primary_key__ = "id"
@classmethod
def table_name(cls):
return "ddl_source_async"

@classmethod
def primary_key(cls):
return "id"

pk_field: PK_TYPE
value_field: VALUE_TYPE = DEFAULT_VALUE
Expand All @@ -226,32 +236,46 @@ class AsyncModel(DeclarationMixin, AsyncActiveRecord):


class CompositeModel(DeclarationMixin, ActiveRecord):
__table_name__ = "ddl_source_composite"
__primary_key__ = ("left_col", "right_col")
@classmethod
def table_name(cls):
return "ddl_source_composite"

@classmethod
def primary_key(cls):
return ("left_col", "right_col")

left_field: Annotated[int, UseColumn("left_col")]
right_field: Annotated[int, UseColumn("right_col")]
value_field: str


class AsyncCompositeModel(DeclarationMixin, AsyncActiveRecord):
__table_name__ = "ddl_source_async_composite"
__primary_key__ = ("left_col", "right_col")
@classmethod
def table_name(cls):
return "ddl_source_async_composite"

@classmethod
def primary_key(cls):
return ("left_col", "right_col")

left_field: Annotated[int, UseColumn("left_col")]
right_field: Annotated[int, UseColumn("right_col")]
value_field: str


class PlainModel(ActiveRecord):
__table_name__ = "ddl_source_plain"
@classmethod
def table_name(cls):
return "ddl_source_plain"

id: int
optional: Optional[str] = None


class AsyncPlainModel(AsyncActiveRecord):
__table_name__ = "ddl_source_async_plain"
@classmethod
def table_name(cls):
return "ddl_source_async_plain"

id: int
optional: Optional[str] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@


class DeepCustomer(ActiveRecord):
__table_name__ = "customers"
__schema_name__ = "ar_crm"
@classmethod
def table_name(cls):
return "customers"

@classmethod
def schema_name(cls):
return "ar_crm"

c: ClassVar[FieldProxy] = FieldProxy()

id: Optional[int] = None
Expand Down Expand Up @@ -1009,8 +1015,8 @@ def test_the_26ai_scenario_is_a_23_line_server(self):
)
backend.introspect_and_adapt()
assert full is not None, (
f"oracle_26ai reports no VERSION_FULL, so the release-update "
f"number that tells 23ai from 26ai cannot be demonstrated"
"oracle_26ai reports no VERSION_FULL, so the release-update "
"number that tells 23ai from 26ai cannot be demonstrated"
)
# Both true at once, and neither read from the other: the product
# name says 26 while the version says 23.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from rhosocial.activerecord.base.field_proxy import FieldProxy
from rhosocial.activerecord.backend.options import ExecutionOptions
from rhosocial.activerecord.backend.schema import StatementType
from typing import Optional

from rhosocial.activerecord.model import ActiveRecord
from rhosocial.activerecord.backend.errors import DatabaseError
Expand All @@ -28,17 +27,29 @@


class SchemaCustomer(ActiveRecord):
__table_name__ = "customers"
__schema_name__ = "ar_crm"
@classmethod
def table_name(cls):
return "customers"

@classmethod
def schema_name(cls):
return "ar_crm"

c: ClassVar[FieldProxy] = FieldProxy()

id: Optional[int] = None
name: str


class SchemaOrder(ActiveRecord):
__table_name__ = "orders"
__schema_name__ = "ar_shop"
@classmethod
def table_name(cls):
return "orders"

@classmethod
def schema_name(cls):
return "ar_shop"

c: ClassVar[FieldProxy] = FieldProxy()

id: Optional[int] = None
Expand Down Expand Up @@ -161,8 +172,14 @@ async def test_async_insert_is_scoped(provisioned):
from rhosocial.activerecord.model import AsyncActiveRecord

class AsyncSchemaCustomer(AsyncActiveRecord):
__table_name__ = "customers"
__schema_name__ = "ar_crm"
@classmethod
def table_name(cls):
return "customers"

@classmethod
def schema_name(cls):
return "ar_crm"

c: ClassVar[FieldProxy] = FieldProxy()

id: _Optional[int] = None
Expand Down
Loading