Skip to content

pg timestamp/timestamptz should be mapped to ISO-8601 compatible string #286

@ImSingee

Description

@ImSingee

Currently, the timestamptz is mapped to YYYY-MM-DD hh:mm:ss.sssZ format and timestamp is mapped to YYYY-MM-DD hh:mm:ss.sss.

The document says "This is compatible with ISO8601 and SQLite’s functions.".

However, this format (use a space instead of T to separate date and time) isn't compatible with ISO-8601. (From Wikipedia, Separating date and time parts with other characters such as space is not allowed in ISO 8601, but allowed in its profile RFC 3339.)

Additionally, SQLite supports using T as separator:

YYYY-MM-DD
YYYY-MM-DD HH:MM
YYYY-MM-DD HH:MM:SS
YYYY-MM-DD HH:MM:SS.SSS
YYYY-MM-DDTHH:MM
YYYY-MM-DDTHH:MM:SS
YYYY-MM-DDTHH:MM:SS.SSS
HH:MM
HH:MM:SS
HH:MM:SS.SSS
now
DDDDDDDDDD

So, I think, powersync should switch to use T as separator instead of the space.

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