carlos
carlos
Explore posts from servers
DTDrizzle Team
Created by carlos on 1/5/2024 in #help
how can i override the zodNullable here?
No description
4 replies
DTDrizzle Team
Created by carlos on 8/11/2023 in #help
There is not enough information to infer relation
export const historyRelations = relations(histories, ({ many }) => ({
files: many(historyFiles),
}));



const history = await ctx.db.query.histories.findFirst({
where: and(
eq(histories.hospitalId, user.organizationId),
eq(histories.id, input.id)
),
with: {
files: {
where: (files, { eq }) => eq(files.historyId, input.id),
},
},
});
export const historyRelations = relations(histories, ({ many }) => ({
files: many(historyFiles),
}));



const history = await ctx.db.query.histories.findFirst({
where: and(
eq(histories.hospitalId, user.organizationId),
eq(histories.id, input.id)
),
with: {
files: {
where: (files, { eq }) => eq(files.historyId, input.id),
},
},
});
im doing this according to the docs. am i missing something?
5 replies
TtRPC
Created by carlos on 7/29/2023 in #❓-help
How do you invalidate queries in nextjs app?
experimental_createTRPCNextAppDirClient don't seems to have the useContext so how do i invalidate queries?
2 replies
DTDrizzle Team
Created by carlos on 5/12/2023 in #help
schema generates wrong index
I have this schema:
export const historyFiles = pgTable('history_files', {
id: serial('id').primaryKey(),
fileId: integer('file_id')
.references(() => files.id)
.notNull(),
historyId: integer('history_id')
.references(() => histories.id)
.notNull(),

createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),
});
export const historyFiles = pgTable('history_files', {
id: serial('id').primaryKey(),
fileId: integer('file_id')
.references(() => files.id)
.notNull(),
historyId: integer('history_id')
.references(() => histories.id)
.notNull(),

createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),
});
why is creating a composite index like: history_files_file_id_users_id_fk
5 replies
DTDrizzle Team
Created by carlos on 5/1/2023 in #help
inArray
For what i've seen pass an empty array to inArray is not supported, how to you handle this cases? using "with" queries and adding it conditonally? or how?
3 replies
DTDrizzle Team
Created by carlos on 4/16/2023 in #help
I think i have found another bug
4 replies
DTDrizzle Team
Created by carlos on 4/11/2023 in #help
Enums
Can pgEnum be converted to zod enums?
26 replies