Skip to content

How to map custom select results to data class? #2976

Answered by simolus3
MattSolvesGames asked this question in Q&A
Discussion options

You must be logged in to vote

Drift offers no builtin conversion mechanisms for custom queries (unless they're written in a drift file), but that's something else. If your query is selecting all columns from the table, you can use the map method on the generated table:

dbClient.customSelect(buildQuery(filters), readsFrom: {dbClient.card}).map((row) => dbClient.card.map(row.data))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MattSolvesGames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants