davebanana
davebanana
DTDrizzle Team
Created by davebanana on 12/13/2023 in #help
How to define `PostgresJsTransaction` generic parameter based on schema?
No description
3 replies
DTDrizzle Team
Created by davebanana on 12/13/2023 in #help
How to define `PostgresJsTransaction` generic parameter based on schema?
I found a way to use ExtractTablesWithRelation
export type SchemaWithRelations = ExtractTablesWithRelations<Schema>
export type SchemaWithRelations = ExtractTablesWithRelations<Schema>
Now that my PostgresJsTransction is defined as follow:
public tx: PostgresJsTransaction<Schema, SchemaWithRelations> | null;
public tx: PostgresJsTransaction<Schema, SchemaWithRelations> | null;
However when using .findMany() without specifying the columns, I get improper hinting.
3 replies