Skip to content

Commit 855a640

Browse files
authored
Add UUID to PRIMARY_KEY type union (#65)
* Add UUID to PRIMARY_KEY type union Include UUID as a valid type for PRIMARY_KEY to support use cases requiring UUIDs. This ensures broader compatibility and type safety in key definitions.
1 parent 6d1ca0a commit 855a640

File tree

8 files changed

+9
-8
lines changed

8 files changed

+9
-8
lines changed

.github/workflows/python-code-style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install poetry
27+
python -m pip install poetry poetry-plugin-export
2828
poetry config virtualenvs.create false
2929
poetry install --no-root --with dev
3030
- name: Check code style with black

.github/workflows/python-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install poetry tox
27+
python -m pip install poetry tox poetry-plugin-export
2828
make poetry-export
2929
- name: Lint with ruff
3030
run: make lint

.github/workflows/python-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install poetry
27+
python -m pip install poetry poetry-plugin-export
2828
poetry config virtualenvs.create false
2929
poetry install --no-root --with dev
3030
- name: Test & publish code coverage

.github/workflows/python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
34-
python -m pip install poetry
34+
python -m pip install poetry poetry-plugin-export
3535
poetry config virtualenvs.create false
3636
poetry install --no-root --with dev
3737
- name: Test with pytest

.github/workflows/python-typing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install poetry tox
27+
python -m pip install poetry tox poetry-plugin-export
2828
make poetry-export
2929
- name: Check typing
3030
run: make typing

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28-
python -m pip install poetry poetry-dynamic-versioning
28+
python -m pip install poetry poetry-dynamic-versioning poetry-plugin-export
2929
3030
- name: Build package
3131
run: |

sqlalchemy_bind_manager/_bind_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(
9090
def __init_bind(self, name: str, config: SQLAlchemyConfig):
9191
if not isinstance(config, SQLAlchemyConfig):
9292
raise InvalidConfigError(
93-
f"Config for bind `{name}` is not a SQLAlchemyConfig" f"object"
93+
f"Config for bind `{name}` is not a SQLAlchemyConfig object"
9494
)
9595

9696
engine_options: dict = config.engine_options or {}

sqlalchemy_bind_manager/_repository/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
# DEALINGS IN THE SOFTWARE.
2020

2121
from typing import Generic, List, TypeVar, Union
22+
from uuid import UUID
2223

2324
from pydantic import BaseModel, StrictInt, StrictStr
2425

2526
MODEL = TypeVar("MODEL")
26-
PRIMARY_KEY = Union[str, int, tuple, dict]
27+
PRIMARY_KEY = Union[str, int, tuple, dict, UUID]
2728

2829

2930
class PageInfo(BaseModel):

0 commit comments

Comments
 (0)