sizzF
sizzF
DTDrizzle Team
Created by boggin on 12/1/2023 in #help
Drizzle + Sveltekit + Cloudflare + Supabase cannot get to work.
Add the option node_compat = true to wrangler.toml.
6 replies
DTDrizzle Team
Created by sizzF on 11/28/2023 in #help
Checking Joined Data Directly from Type Recommendation and Retrieved Data in Dynamic findMany
Thanks, I can define the with type in advance. However, since the items in the with are determined dynamically, I have no way of knowing what types are in the result. I'm happy with this though. schema.ts
export type FindManyUserWithOptions = NonNullable<Parameters<typeof db['query']['user']['findMany']>[0]>['with']
export type FindFirstUserWithOptions = NonNullable<Parameters<typeof db['query']['user']['findFirst']>[0]>['with']
export type FindManyUserWithOptions = NonNullable<Parameters<typeof db['query']['user']['findMany']>[0]>['with']
export type FindFirstUserWithOptions = NonNullable<Parameters<typeof db['query']['user']['findFirst']>[0]>['with']
handler.ts
const result = await dbToUse.query.user.findMany({
columns: { password: false },
...queryOptions,
with: modifyWithOptions(
{
Company: {
columns: companyJoinColumns,
with: { Users: true },
},
Partner: { columns: companyJoinColumns },
} as FindManyUserWithOptions,
params.offJoin
)
});
const result = await dbToUse.query.user.findMany({
columns: { password: false },
...queryOptions,
with: modifyWithOptions(
{
Company: {
columns: companyJoinColumns,
with: { Users: true },
},
Partner: { columns: companyJoinColumns },
} as FindManyUserWithOptions,
params.offJoin
)
});
7 replies
DTDrizzle Team
Created by sizzF on 11/28/2023 in #help
Checking Joined Data Directly from Type Recommendation and Retrieved Data in Dynamic findMany
Thanks so much Angelelz, I'll check that out quickly.
7 replies