diesel icon indicating copy to clipboard operation
diesel copied to clipboard

Feature: table appearing multiple times in select query results

Open Diggsey opened this issue 6 years ago • 2 comments

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>;

Diggsey avatar Apr 04 '18 00:04 Diggsey

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

dessalines avatar Dec 14 '20 14:12 dessalines

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.

Ten0 avatar Dec 15 '20 01:12 Ten0

Closed by #2254

weiznich avatar Dec 22 '22 13:12 weiznich