DIPSAS / FluentDbTools

FluentDbTools provides a fluent SQL abstraction layer for creating database connections, building sql queries and migrating your database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CreateAliasForType does not account for SQL keywords

jaalu opened this issue · comments

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.

This should be fixed