Replies: 2 comments 2 replies
-
Hi @dcsan, did you find a solution for this? I'm looking for a solution to this type of problem |
Beta Was this translation helpful? Give feedback.
2 replies
-
Really old thread, but I just ran into a similar situation, here's what I came up with in case anyone else finds themselves on this page looking for an answer: const chunkPartialColumns = {
sourceId: true,
text: true,
} as const;
export type ChunkPartial = Pick<typeof chunk.$inferSelect, keyof typeof chunkPartialColumns>;
let chunks: ChunkPartial[];
chunks = await db.query.chunk.findMany({
columns: chunkPartialColumns,
})
return chunks; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a query that doesn't include all columns in a table.
how to I create a type that reflects this?
eg i have a func returning values that skips some columns:
elsewhere I have the schema and then this to define the
Chunk
typecurrently I have a little TS workaround but not sure if there's a better way to do it with Drizzle inference?
Beta Was this translation helpful? Give feedback.
All reactions