fsprojects / Rezoom.SQL

Statically typechecks a common SQL dialect and translates it to various RDBMS backends
MIT License
669 stars 25 forks source link

Ambiguous columns not recognized with * #23

Closed rkosafo closed 6 years ago

rkosafo commented 7 years ago

Given the query

Select *
From Users u
Inner Join Comments c on u.id = c.authorId

The id field is duplicated. In the final object, Comments.Id is used while User.id is ignored. Is it possible to have it fail as it will be easy to get the wrong data?

This however gives the right exception

Select id, *
From Users u
Inner Join Comments c on u.id = c.authorId

It must be noted that the current behaviour is consistent though with SSMS.

rspeele commented 7 years ago

I agree with you, this is a mistake on RZSQL's part regardless of the SSMS behavior. Duplicate column names should always be an error.

rspeele commented 7 years ago

a3be5f1 should fix this, again I am delaying the NuGet package release till I get around to fixing a couple more things.