markk
markk
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
99.9% sure there's nothing wrong with my definitions tho
19 replies
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
yea me too.. I've spent ages debugging. Gonna try dig into the drizzle src and see what might be causing it
19 replies
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
not too sure why mine is not working, seems like a bug
19 replies
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
oh I see, thanks, that's what I initially thought
19 replies
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
1 chat -> many messages
19 replies
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
it's one to many right?
19 replies
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
(sorry for hijacking this thread) I didn't think my specific example was a many-to-many situation though
19 replies
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
Could be good to make this a bit more clear in the error message, see there is a lot of recent posts in this channel about this specific error message
19 replies
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
Ah ok, I was trying to do something like this, need an intermediate I guess. Althoo I don't think you really should 🤔
export const chatRelations = relations(chat, ({ one, many }) => ({
user: one(users, {
fields: [chat.userId],
references: [users.id],
relationName: "userChats",
}),
message: many(message, { relationName: "chatMessages" }),
}));

export const messageRelations = relations(message, ({ one }) => ({
chat: one(chat, {
fields: [message.chatId],
references: [chat.id],
relationName: "chatMessages",
}),
}));
export const chatRelations = relations(chat, ({ one, many }) => ({
user: one(users, {
fields: [chat.userId],
references: [users.id],
relationName: "userChats",
}),
message: many(message, { relationName: "chatMessages" }),
}));

export const messageRelations = relations(message, ({ one }) => ({
chat: one(chat, {
fields: [message.chatId],
references: [chat.id],
relationName: "chatMessages",
}),
}));
19 replies
DTDrizzle Team
Created by Budi on 3/30/2024 in #help
Studio not enough info to infer relation
is an intermediate table necessary in this instance?
19 replies
DTDrizzle Team
Created by markk on 3/22/2024 in #help
Nullable IDs
hmm that makes for using the type a little interesting
8 replies
DTDrizzle Team
Created by markk on 3/22/2024 in #help
Nullable IDs
ohh because a default is provided
8 replies
DTDrizzle Team
Created by markk on 3/22/2024 in #help
Nullable IDs
I mean on the surface level seems like a bug to me but maybe something fundamental is going over my head
8 replies
DTDrizzle Team
Created by markk on 3/22/2024 in #help
Nullable IDs
No description
8 replies
DTDrizzle Team
Created by markk on 3/22/2024 in #help
Nullable IDs
No description
8 replies