Monopolo11
Monopolo11
DTDrizzle Team
Created by Monopolo11 on 4/25/2025 in #help
Generic base repository abstract class
Any clues or examples on how to achieve this?
4 replies
DTDrizzle Team
Created by Monopolo11 on 4/25/2025 in #help
Generic base repository abstract class
Also for reference, this is how I’m getting the DB and DBTransaction types
export const db = drizzle({
client: psClient,
schema,
casing: "snake_case",
});

export type DBTransaction = Parameters<Parameters<typeof db.transaction>[0]>[0];
export type DB = typeof db;
export const db = drizzle({
client: psClient,
schema,
casing: "snake_case",
});

export type DBTransaction = Parameters<Parameters<typeof db.transaction>[0]>[0];
export type DB = typeof db;
4 replies
DTDrizzle Team
Created by Monopolo11 on 4/25/2025 in #help
Generic base repository abstract class
It looks like it should work but I get the following error in the this.table when creating the select
Argument of type 'TTable' is not assignable to parameter of type 'TableLikeHasEmptySelection<TTable> extends true ? DrizzleTypeError<"Cannot reference a data-modifying statement subquery if it doesn't contain a `returning` clause"> : TTable'.
Type 'PgTable<Required<{ schema: string | undefined; name: string; dialect: string; columns: Record<string, PgColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>>; }>>' is not assignable to type 'TableLikeHasEmptySelection<TTable> extends true ? DrizzleTypeError<"Cannot reference a data-modifying statement subquery if it doesn't contain a `returning` clause"> : TTable'.
Argument of type 'TTable' is not assignable to parameter of type 'TableLikeHasEmptySelection<TTable> extends true ? DrizzleTypeError<"Cannot reference a data-modifying statement subquery if it doesn't contain a `returning` clause"> : TTable'.
Type 'PgTable<Required<{ schema: string | undefined; name: string; dialect: string; columns: Record<string, PgColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>>; }>>' is not assignable to type 'TableLikeHasEmptySelection<TTable> extends true ? DrizzleTypeError<"Cannot reference a data-modifying statement subquery if it doesn't contain a `returning` clause"> : TTable'.
4 replies
DTDrizzle Team
Created by Monopolo11 on 1/21/2024 in #help
Transform output/ simplified relationship
I wanted to simplify the object, as the array that it returns is too complex and brings extra information
5 replies
DTDrizzle Team
Created by Monopolo11 on 1/21/2024 in #help
Transform output/ simplified relationship
Or something like the example in the second case https://playground.prisma.io/examples/reading/relations/nested-reads
5 replies
DTDrizzle Team
Created by Monopolo11 on 1/21/2024 in #help
Transform output/ simplified relationship
Maybe a select statement, but how can I turn the relation into an array?
5 replies
DTDrizzle Team
Created by Monopolo11 on 1/18/2024 in #help
Base Schema / Table definition
Is there a way to do this with the relation too?
10 replies
DTDrizzle Team
Created by Monopolo11 on 1/18/2024 in #help
Base Schema / Table definition
Thanks!
10 replies
DTDrizzle Team
Created by Monopolo11 on 1/18/2024 in #help
Base Schema / Table definition
No description
10 replies
DTDrizzle Team
Created by Monopolo11 on 1/18/2024 in #help
Base Schema / Table definition
It doesn’t work, it throws an error, saying that the return type is any
10 replies