kysely
kysely copied to clipboard
Behavior when an alias matches some existing table name
Hi. I'm just wondering whether example 2 (playground link below) is expected behavior (known edge case, won't fix, etc) or if it's a bug. I skimmed through the codebase/issues but couldn't find anything similar.
Minimal reproduction
Kysely playground: link
Use case
I encountered this in a db where a view is used as a helper for some tables. For example:
await db
.selectFrom("person_details_view as person")
.select(["some_field_that_exists_in_table_but_does_not_exist_in_view"])
.execute();
That's a bug. Thanks for bringing this up!
Might already be fixed (by accident) in the v0.28 branch.
Might already be fixed (by accident) in the v0.28 branch.
I can reproduce the bug on the latest v0.28 branch (points to 5d38c1b52e8f at time of writing).