Liam
Liam
Explore posts from servers
DTDrizzle Team
Created by andystevenson on 12/27/2024 in #help
sqliteTable deprecated.
export const workspaceMembers = sqliteTable(
"workspace_member",
{
workspaceId: text("workspace_id").notNull(),
userId: text("user_id").notNull(),
createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
updatedAt: integer("updated_at", { mode: "timestamp" }).notNull(),
},
(table) => ({
pk: primaryKey({ columns: [table.workspaceId, table.userId] }),
}),
);
export const workspaceMembers = sqliteTable(
"workspace_member",
{
workspaceId: text("workspace_id").notNull(),
userId: text("user_id").notNull(),
createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
updatedAt: integer("updated_at", { mode: "timestamp" }).notNull(),
},
(table) => ({
pk: primaryKey({ columns: [table.workspaceId, table.userId] }),
}),
);
5 replies
DTDrizzle Team
Created by andystevenson on 12/27/2024 in #help
sqliteTable deprecated.
Running into this on 0.38.3 with the following table:
5 replies
DTDrizzle Team
Created by nightwatch128 on 11/10/2024 in #help
TypeError: client.migrate
Getting this aswell, did you find a solution?
9 replies
DTDrizzle Team
Created by Liam on 7/31/2024 in #help
There is not enough information to infer relation
5 replies
DTDrizzle Team
Created by Liam on 7/31/2024 in #help
There is not enough information to infer relation
The weird thing is that as far as I can tell this is a one-to-one relation, so much of the advice on other tables does not apply here
5 replies
DTDrizzle Team
Created by Liam on 7/8/2023 in #help
Drizzle-zod Include Relations
I did it like so if anyone needs it for future reference (cc @pudgereyem @shreddish )
const userValidator = createInsertSchema(users);

const userDataValidator = z.object({
data: createInsertSchema(data),
});

export const insertUserWithDataValidator = userValidator.merge(userDataValidator);
const userValidator = createInsertSchema(users);

const userDataValidator = z.object({
data: createInsertSchema(data),
});

export const insertUserWithDataValidator = userValidator.merge(userDataValidator);
You can also do it via extent, albeit with some wonky behaviours sometimes if you start adding in omits and what not
const userWithDataValidator = createInsertSchema(users).extend({
data: createInsertSchema(data)
});
const userWithDataValidator = createInsertSchema(users).extend({
data: createInsertSchema(data)
});
10 replies
DTDrizzle Team
Created by bun on 4/1/2024 in #help
dates in sqlite not being evaluated, causing "Invalid Date"
Hey OP, did you ever find a solution to this?
4 replies
DTDrizzle Team
Created by broly on 2/8/2024 in #help
Cannot read properties of undefined (reading 'columns')
beyond using the local server
5 replies
DTDrizzle Team
Created by broly on 2/8/2024 in #help
Cannot read properties of undefined (reading 'columns')
Hey did you ever wind up finding a fix for this?
5 replies