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
Collection columns / .from() reference field bug #610
There is a weird effect caused by the collection's reference name and its columns.
If the string used to reference the collection in the from is also a field of the collection's schema the query breaks.
typeSchema={email: string;createdAt: Date;}constemailCollection=createCollection<Schema>({ ... });// This works fineconstresult=useLiveQuery(q=>q.from({t: emailCollection}).orderBy(({ t })=>t.createdAt,"desc"));// This breaksconstresult=useLiveQuery(q=>q.from({email: emailCollection}).orderBy(({ email })=>email.createdAt,"desc"));
Right now I discovered that this breaks at least the sorting. In this case for "breaks" I mean that there is no sorting.
Thats for the report, this was due to some legacy code that was attempting to support using a select alias in a orderBy, but thats not the intended design and we don't support it at the type level. I've removed the code and fixed it in #637
Activity
samwillis commentedon Oct 3, 2025
Thats for the report, this was due to some legacy code that was attempting to support using a select alias in a orderBy, but thats not the intended design and we don't support it at the type level. I've removed the code and fixed it in #637