Extract type from SubQuery
If I have a query like this I intend to use as a subquery:
Is there any way I can extract a type from this, such like:
Is there any way I can extract a type from this, such like:
const foo = db.select({
id: fooTable.id,
name: fooTable.name,
enabled: fooTable.enabled,
}).from(fooTable).as('foo');type Foo = {
id: number;
name: string;
enabled: boolean;
}