stephenafamo/bob

Unexpected query for psql.F() and As()

daddz opened this issue · 1 comments

I'm not sure if this is intentional but the generated query was not what I expected.

Reproduction:

psql.Select(
  sm.Columns(psql.F("min", "some_col").As("renamed"))
  sm.From("some_table"))

Result:

SELECT 
min(some_col)renamed 
FROM some_table

Expected:

SELECT 
min(some_col) AS renamed 
FROM some_table

What's the reason that no "AS" is being added?

I'll have to investigate this. Thanks for reporting