Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribers SQL query placeholder #408

Closed
andreafa opened this issue Jun 29, 2021 · 1 comment
Closed

Subscribers SQL query placeholder #408

andreafa opened this issue Jun 29, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@andreafa
Copy link

Within: Subscribers > All Subscribers > Advanced
the current placeholder is:
subscribers.name LIKE '%user%' or subscribers.status='blocklisted'

Clicking the [Query] button then the [Export] link, I get the error:
{"message":"Error preparing subscriber query: pq: invalid reference to FROM-clause entry for table "subscribers""}

Everything works fine using this syntax (without the subscribers. prefix):
name LIKE '%user%' OR email LIKE '%email%'

I could not find how to extract the status information.

@andreafa andreafa added the bug Something isn't working label Jun 29, 2021
@knadh
Copy link
Owner

knadh commented Jun 29, 2021

Ah, this is a bug. In the export query, the subscribers table is internally aliased as s. Will fix this.

For now, you can hit the export API directly by replacing the subscribers. with s.

s.name LIKE '%user%' OR s.status != 'blocklisted'

(Query is urlencoded below)
/api/subscribers/export?query=+s.name+LIKE+%27%25user%25%27+or+s.status!%3D%27blocklisted%27

@knadh knadh self-assigned this Jun 29, 2021
@knadh knadh closed this as completed Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants