James
James
DTDrizzle Team
Created by James on 1/17/2024 in #help
Extract type from SubQuery
If I have a query like this I intend to use as a subquery:
const foo = db.select({
id: fooTable.id,
name: fooTable.name,
enabled: fooTable.enabled,
}).from(fooTable).as('foo');
const foo = db.select({
id: fooTable.id,
name: fooTable.name,
enabled: fooTable.enabled,
}).from(fooTable).as('foo');
Is there any way I can extract a type from this, such like:
type Foo = {
id: number;
name: string;
enabled: boolean;
}
type Foo = {
id: number;
name: string;
enabled: boolean;
}
24 replies
DTDrizzle Team
Created by James on 7/3/2023 in #help
Passing SQL functions to insert
Is there any way to pass a SQL function like gen_random_uuid() to the insert function, for a specific (non-primary ID) column? Something like concat('foo_', gen_random_uuid()) for example.
2 replies