hayata
hayata
DTDrizzle Team
Created by hayata on 11/20/2024 in #help
What type to use for a batch item
I'm trying to type the array used to hold queries to be batched with the batch API.
const queries: ??? = [];

queries.push(db.query.users.findMany...)

await db.batch(queries);
const queries: ??? = [];

queries.push(db.query.users.findMany...)

await db.batch(queries);
What should I put for ???
1 replies
DTDrizzle Team
Created by hayata on 11/19/2024 in #help
How to log out batch operations
I realized that even when I turn on logget to true when initializing a drrizle client, it won't log out queries batched together Does anyone know how to log out batch queries?
1 replies
DTDrizzle Team
Created by hayata on 10/14/2024 in #help
How to use sub query or CTE inside values method of insert?
I want to the results from CTE or sub query inside the select
const tableOneSubQuery = db.select({name: tableOne.columnOne}).from(tableOne).as('table_one_sub_query');

db.insert(tableTwo).values({columnTwo: tableOneSubQuery.name});
const tableOneSubQuery = db.select({name: tableOne.columnOne}).from(tableOne).as('table_one_sub_query');

db.insert(tableTwo).values({columnTwo: tableOneSubQuery.name});
This seems to be a wrong way to do this (TypeScript complains). What is the right way to go about this?
1 replies