diesel
diesel copied to clipboard
Feature: table appearing multiple times in select query results
Mostly creating this issue so I can subscribe to it.
Possible implementation assuming no significant changes to diesel:
// Internal
struct Alias<To, Id>(To);
impl<To, Id> {traits} for Alias<To, Id> {
... {forward to "To" implementation of traits}...
}
// External
define_alias!(Foo, Bar);
// Expands to:
struct FooId;
type Foo = Alias<Bar, FooId>;
Does anyone know of any messier workarounds to this? I have a comment table, that has column parent_id: Option<Commentd>
, and I need to join to itself to get its parents. Maybe a SQL view and then redefine that view in rust code?
#2254
Does anyone know of any messier workarounds to this? I have a comment table, that has column
parent_id: Option<Commentd>
, and I need to join to itself to get its parents. Maybe a SQL view and then redefine that view in rust code?#2254
Yup, redefined view is the workaround we use.
Closed by #2254