Closed benjamin79 closed 1 month ago
Hi,
i have an array (columnsToSelect) of columns to which i want add another one
columnsToSelect.push("(firstname || ' ' || lastname) as fullname");
SELECT ${sql(columnsToSelect)} FROM ${sql(table)}
I tried different combinations with " and ' but without success.
error: missing FROM-clause entry for table
missing FROM-clause entry for table
Is this possible?
thanks
You need to use fragments to create the as ? parts.
as ?
https://github.com/porsager/postgres?tab=readme-ov-file#building-queries
Hi,
i have an array (columnsToSelect) of columns to which i want add another one
columnsToSelect.push("(firstname || ' ' || lastname) as fullname");
SELECT ${sql(columnsToSelect)} FROM ${sql(table)}
I tried different combinations with " and ' but without success.
error:
missing FROM-clause entry for table
Is this possible?
thanks