daveycodez
DTDrizzle Team
•Created by divramod on 8/9/2024 in #help
how to infer the type of the db for the postgres driver
How can we infer types in an external package, I can't do typeof db since schema exists on the application, not on the external package.
4 replies
DTDrizzle Team
•Created by daveycodez on 1/13/2025 in #help
Inferring Types from Schema?
It's correctly inferring table names for the table parameter perfectly, but the db.query is yelling
5 replies
DTDrizzle Team
•Created by daveycodez on 1/13/2025 in #help
Inferring Types from Schema?
how am I supposed to type this ?
5 replies
DTDrizzle Team
•Created by daveycodez on 1/13/2025 in #help
Inferring Types from Schema?
I'm trying to set up an external package to call a generic function to use findMany and findFirst just by passing schema and table name as string. I can only seem to get it to work internally if I use my schema's type, but I want it to be inferred
5 replies
DTDrizzle Team
•Created by daveycodez on 1/13/2025 in #help
Inferring Types from Schema?
Type 'keyof ExtractTablesWithRelations<TSchema>' cannot be used to index type 'TSchema extends Record<string, never> ? DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?"> : { [K in keyof ExtractTablesWithRelations<...>]: RelationalQueryBuilder<...>; }'.ts(2536)
(property) PgDatabase<NeonHttpQueryResultHKT, TSchema, ExtractTablesWithRelations<TSchema>>.query: TSchema extends Record<string, never> ? DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?"> : { [K in keyof ExtractTablesWithRelations<...>]: RelationalQueryBuilder<...>; }
5 replies