Skip to content

Add UUID and Enum type processors (v0.3.10)#25

Merged
CollierKing merged 1 commit into
mainfrom
feature/issue-24-uuid-enum-support
May 5, 2026
Merged

Add UUID and Enum type processors (v0.3.10)#25
CollierKing merged 1 commit into
mainfrom
feature/issue-24-uuid-enum-support

Conversation

@CollierKing

Copy link
Copy Markdown
Owner

Summary

  • Adds D1UUID and D1Enum type processors so uuid.UUID objects and Python enum.Enum subclasses round-trip correctly through D1's TEXT storage
  • Registers both types in colspecs so SQLAlchemy automatically uses the D1-aware subclasses for UUID and Enum columns
  • Adds DDL type compiler methods (visit_UUID, visit_uuid, visit_enum) mapping to TEXT
  • Resolves all pre-existing mypy strict-mode errors across all five source files with full type annotations
  • Adds 8 new integration tests (4 UUID, 4 Enum) in both the REST API and Worker test suites

Closes #24
Closes #18

Test plan

  • uv run pytest tests/ — 20 unit tests pass
  • make integration_tests — 147/148 pass (1 pre-existing flaky timing test)
  • uv run mypy src/sqlalchemy_cloudflare_d1/ — 0 errors
  • uv run ruff check src/ && uv run ruff format src/ — clean

Adds D1UUID and D1Enum type processors so SQLAlchemy uuid.UUID objects
and Python enum classes round-trip correctly through D1's TEXT storage.
Updates colspecs to map Uuid and Enum to their D1-aware subclasses.

Also resolves all pre-existing mypy strict-mode errors across all five
source files and adds full type annotations throughout the codebase.
@CollierKing CollierKing merged commit 3661aaf into main May 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UUID & Enum Add type processors for Time, Interval, UUID, and Enum

1 participant