Jakesdoc
Jakesdoc
Explore posts from servers
DTDrizzle Team
Created by Jakesdoc on 10/8/2024 in #help
Transaction Type
Is there a type to use for passing a transaction into a function? I would like to do something like
await db.transaction(async (tx) => insertUser(tx, form.data))
await db.transaction(async (tx) => insertUser(tx, form.data))
but the type of tx is super long and not convenient at all.
16 replies
DTDrizzle Team
Created by Jakesdoc on 4/22/2024 in #help
Failed push to planetscale
Every time I try to push my schema to Planetscale, I get the following error:
if (unsquashed.columns.length === 1 && currentSchema.tables[statement.tableName].columns[unsquashed.columns[0]].type === "serial" && prevSchema.tables[statement.tableName].columns[unsquashed.columns[0]].type === "serial" && currentSchema.tables[statement.tableName].columns[unsquashed.columns[0]].name === unsquashed.columns[0]) {
^

TypeError: Cannot read properties of undefined (reading 'type')
if (unsquashed.columns.length === 1 && currentSchema.tables[statement.tableName].columns[unsquashed.columns[0]].type === "serial" && prevSchema.tables[statement.tableName].columns[unsquashed.columns[0]].type === "serial" && currentSchema.tables[statement.tableName].columns[unsquashed.columns[0]].name === unsquashed.columns[0]) {
^

TypeError: Cannot read properties of undefined (reading 'type')
1 replies
DTDrizzle Team
Created by Jakesdoc on 4/22/2024 in #help
Select parent rows where child exists
I want to use a relational query to select all users and their posts where users have at least one post.
6 replies
DTDrizzle Team
Created by Jakesdoc on 4/17/2024 in #help
Generate relational select types
In prisma, you can do something like Prisma.GetUserPayload<{include: {posts: true}}> and that will give you the type of the user and include the posts. Is there something like this in drizzle?
1 replies