Double quotes removed from datasource query


In my FA dashboard I’m trying to add a datasource with the following query:

select count(distinct "userId") as value from transactions where status = 'SUCCESS'

This ends up being sent to my FA backend as:

select count(distinct userId) as value from transactions where status = 'SUCCESS'

Note that the double quotes have been removed. As a result, PostGres complains that the column userid (with a lower case i) does not exist.

How can I force FA do send my query with the double quotes in place?

Hello @timothyarmes,

Thanks for your feedback.
I was unable to reproduce the problem.
On my laptop, I was able to create a chart with a SQL query with the exact same format than your example. \ escaping characters were coming in the request.

Can you please share your packages version? (pg, sequelize, forest-express-sequelize, etc.)


Thanks @Sliman_Medini .

I hadn’t really wanted to touch the versions created by the FA backend creation tool, but updating pg did fix the issue.

I note that I’m currently using sequalize 5.22.5. I tried updating to v6 but the code broke on uses of ‘connection.import’. Do you know of FA supports Sequalize 6? I don’t wish to spend time trying to upgrade if it’s in vain :slight_smile:

Ok, good if it’s fixed.

I know we have servers internally that are working with sequelize 6. So it should work for you.