CreateAliasForType does not account for SQL keywords
jaalu opened this issue · comments
Jørgen Lund commented
Attempting to construct a query for all fields of an object AggressiveStork
var sql = SqlBuilder
.Select()
.Fields<AggressiveStork>(x => x.All())
.OnSchema(DbConfig.Schema)
.Build();
leads to SqlBuilder constructing the query
SELECT as.* FROM AggressiveStork as
In Postgres, the final as
is interpreted as the SQL keyword AS
, causing a syntax error.
Arild Håkon Olsen commented
This should be fixed