You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Time is rendered as DATETIME, so a time-of-day is silently stored as a 1970-01-01 timestamp #79
The dialect renders Core's Time as DATETIME. The column is created, and the substitution is invisible from Core, because SQLAlchemy's own Time type re-derives the value on the way out:
typed select() on the column hands back time(14, 30) — looks correct
the same column read without the Core type in play is 1970-01-01T14:30:00Z
inspect() reports the column type as DATETIME
So it round-trips correctly through a typed Core select and is wrong through everything else: reflection, any consumer reading the column generically, anything comparing against another engine's storage of the same value.
Why this is the awkward failure mode
A column that couldn't be created is a five-minute problem. A column that exists and quietly holds a different type is the kind that surfaces months later, in whichever consumer wasn't going through Core's typed path. The date part isn't neutral either — it's a real 1970-01-01 sitting in the data, and it sorts and compares as one.
Suggested fix
Refuse Time at compile time on an engine that has no such type, the same way an unsupported type is refused elsewhere. If a substitution is preferred over a refusal, TEXT at least doesn't invent a date, but I'd rather it just raised.
Activity