Skip to content

Temporal and decimal codecs for SQLite and MySQL #90

Open

Description

@artile

Signal

We want explicit, documented codecs for time and money on SQLite and MySQL:

  • timestamp: DateTime.Utc. Storage is chosen per table: ISO-8601 text, or integer epoch milliseconds.
  • date: a calendar date as YYYY-MM-DD text with no time zone.
  • decimal(p, s): BigDecimal, stored as text on SQLite. It is never a float.

Why (MyRemotely)

  • 274 DateTime columns and 5 Decimal columns.
  • ADR-0019 in our app: a time tied to a unit uses that unit's time zone, and a calendar date has no zone. The codec must never shift a calendar date.
  • SQLite has no native types for these. A wrong default here corrupts data quietly during the move.

Part of #52: the CAFE-stack roadmap signal from MyRemotely. This shows the direction we want, and it is not a demand. We can send a PR if you accept the idea.

Activity

  1. Makisuo commented on Oct 25, 2026

    @Makisuo
    Contributor

    The SQLite timestamp part landed in #119: SQLite.timestamp maps DateTime.Utc to SQLite's own YYYY-MM-DD HH:MM:SS.SSS UTC text, so it compares correctly with what strftime/datetime write. It refuses values outside years 0000–9999, and #120 adds SQLite.timestampNow. integer refuses values past 2^53. Still open: epoch-millisecond storage, a zoneless date, decimal(p, s), and all of MySQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions