vrana/notorm

Support alias for parent table

Opened this issue · 1 comments

When joining tables, NotOrm knows how to put an alias on a joined table if its "public" name differs from its real table name (because of a user customized structure). Columns are then correctly identified by "$name.$column" string ($name actually being the alias).

But it doesn't work for the parent table.

I tried to set up a user structure so to add explicit non-defaut database names on a couple of tables. createJoins works if these tables are refered in select. It doesn't work if the parent table itself is non trivial.

I patched my NotOrm copy for my specific needs. But I feel like it's a more general issue. Result objects may have distinct "name" and "table" attributes so that sql buiding could alias the parent table in the same way than joined tables.

paip commented

Having the same issues.