-
Hey there :) The set-up is really not obvious and there's no diagnostic to tell you if anything was wrong (no actual failure or fatalError in DEBUG, etc.). A lot of "f***ing around, finding out", but I'm stuck, so here we are :) Here's the setup I have, give or take: struct Message: ... conformances {
static let databaseTableName = "messages"
static let reactions = hasMany(Message.Reaction.self)
let id: ...
}
extension Message {
struct Reaction: ... conformances {
static let databaseTableName = "reactions"
static let message = belongsTo(Message.self)
let messageId: ...
}
} Whatever I try to do, for example this: try Message
.including(all: Message.reactions)
.fetchAll(db) doesn't seem to work. Inside my Would appreciate any help with this, and hopefully it'll help me understand how it all works :) Tried a lot of messing around specifying key, foreignKey, etc, but nothing helps. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok, so it's working now. Thanks anyways! |
Beta Was this translation helpful? Give feedback.
Ok, so it's working now.
The issue is I was checking if
row.hasColumn("reactions")
which doesn't work. I just removed it and everything is working now.I am confused thought with why it's not working, I have a different association where it worked 🤷
Thanks anyways!