Skip to content

Bind date and datetime values as text in the SQLite writers - #2174

Merged
abrignoni merged 1 commit into
mainfrom
fix/sqlite-datetime-text
Sep 13, 2026
Merged

Bind date and datetime values as text in the SQLite writers#2174
abrignoni merged 1 commit into
mainfrom
fix/sqlite-datetime-text

Conversation

@abrignoni

@abrignoni abrignoni commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Binds date and datetime values as text in the LAVA and KML writers.

  • lavafuncs.bind_dates_as_text returns str(value) for a date or datetime, which is the text sqlite3's default adapters wrote: isoformat(" ") for a datetime and isoformat() for a date.
  • lava_insert_sqlite_data, lava_insert_sqlite_media_item and kmlgen bind through it, so those writes no longer use the default adapters Python 3.12 deprecated.
  • admin/test/scripts/test_sqlite_date_binding.py pins the stored text and checks that no adapter warning is raised.

Columns typed datetime are not affected. They were already converted to epoch values before binding.

Same change in ALEAPP #1399, RLEAPP #468, VLEAPP #209, DLEAPP #129.

🤖 Generated with Claude Code

lava_insert_sqlite_data, lava_insert_sqlite_media_item and kmlgen passed date and datetime objects straight to sqlite3, which converts them through default adapters that are deprecated as of Python 3.12 and warn on every value. The new lavafuncs.bind_dates_as_text returns str(value) for those objects, which is exactly the text the adapters wrote, isoformat(" ") for a datetime and isoformat() for a date, so the stored text does not change. admin/test/scripts/test_sqlite_date_binding.py pins both the stored text and the absence of the warning.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant