Skip to content

Add DateTime support, fix D1_TYPE_ERROR on datetime inserts (Issue #13)#14

Merged
CollierKing merged 2 commits into
mainfrom
feature/issue-13-datetime-support
Feb 3, 2026
Merged

Add DateTime support, fix D1_TYPE_ERROR on datetime inserts (Issue #13)#14
CollierKing merged 2 commits into
mainfrom
feature/issue-13-datetime-support

Conversation

@CollierKing

Copy link
Copy Markdown
Owner

Summary

  • Fixes D1_TYPE_ERROR for datetimes #13 — D1 rejects Python datetime objects with D1_TYPE_ERROR: Type 'object' not supported
  • Added D1DateTime type processor that converts datetime to ISO 8601 strings on bind and parses them back to datetime on result
  • Bumped version to 0.3.6

Changes

  • src/sqlalchemy_cloudflare_d1/dialect.pyD1DateTime class + registered in colspecs
  • tests/integration/test_restapi_integration.py — 5 new tests (basic, non-UTC tz, nullable, ORM session, filter query)
  • tests/integration/test_worker_integration.py — 4 new tests (basic, non-UTC tz, nullable, ORM session)
  • examples/workers/src/entry.py — 4 new Worker endpoints
  • CHANGELOG.md — v0.3.6 entry
  • pyproject.toml — version bump to 0.3.6

Test plan

  • REST API integration tests pass (5/5)
  • Worker integration tests pass (4/4)
  • Standalone reproduction script confirms fix
  • Pre-commit hooks pass (ruff, ruff-format, codespell, etc.)

D1 rejects Python datetime objects with D1_TYPE_ERROR. Added D1DateTime
type processor that converts datetimes to ISO 8601 strings on bind and
parses them back on result. Bump version to 0.3.6.
Pre-commit used ruff v0.5.0 while CI lint used whatever uv resolved
(0.12.4), causing formatting disagreements on multi-line asserts.
Now pinned to the same version everywhere.
@CollierKing CollierKing merged commit a717fb4 into main Feb 3, 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.

D1_TYPE_ERROR for datetimes

1 participant