rnantes
(Reid Nantes)
2
@0xTim @graskind I think a standardized KeyPathReflection/KeyPathIterable which allows for the retrieval/iteration of the properties for a given struct/class would be very useful. I believe this would be valuable for SQL model encoding/decoding performance especially if cached. @Alejandro helped me to get his and @rxwei's experimental KeyPathReflection library working with Swift 5.6/5.7 a while ago. I've created a PR to get KeyPathReflection working on Swift 5.6 & 5.7. I've been using it for some SQLKit extensions that allow me to get the static properties names of a given struct and use them as column names in select queries. Wondering if we could look into this further for better Fluent performance.
graskind
(Gwynne Raskind)
3
Unfortunately, it's of limited value in terms of Fluent 4; there are numerous design flaws (or, at the very least, design choices that were made due to the limitations of Swift at the time) that would prevent it from realizing more than minimal benefits from the KeyPathReflection work (though I hasten to add that that work is excellent!).