Replies: 2 comments
-
type TableWithCursor = AnyTable & { user: any, cursorId: any } It's not perfect but it's very simple. |
Beta Was this translation helpful? Give feedback.
-
Turns out both solutions drop the type information. I settled on this for now-- const getPagedResult = async <
and everything's working fine with caveats-- 1) whenever calling this function with a new table it has to be added to the extends defintion and 2) typescript's compiler isn't able to infer that items is of type T["$inferSelect"][], so it needs the ts-ignore statement to be happy. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Assume you have some tables with similar properties-- for instance this one, where multiple tables have cursors.
The following code... works... But is there a more ergonomic way I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions