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

Feature: Live Query WHERE clause should process Params #4026

Open
2 tasks done
OTheNonE opened this issue May 11, 2024 · 6 comments
Open
2 tasks done

Feature: Live Query WHERE clause should process Params #4026

OTheNonE opened this issue May 11, 2024 · 6 comments
Assignees
Labels
feature New feature or request topic:live This is related to live queries and push notifications

Comments

@OTheNonE
Copy link

OTheNonE commented May 11, 2024

Original: Bug: Live Query using WHERE clause with variables does not work.

Describe the bug

Creating a Live Query using WHERE clause with variables does not work. It works to hardcode the statement for the WHERE clause, but if you are using a variable, it does not work.

Steps to reproduce

Create two LIVE queries in Surrealist for comparing. The first:

LIVE SELECT * FROM measurement WHERE location == 'A Location';

The second:

LET $location = 'A Location'
LIVE SELECT * FROM measurement WHERE location == $location;

Create a measurement record:

CREATE measurement CONTENT {
    location: 'A Location'
};

Expected behaviour

The expected behaviour is that both LIVE queries should give live updates on the changes to the table. What happens is that the first LIVE query gives live results, while the second LIVE query with the variable does not give any update.

SurrealDB version

1.4.2 for windows on x86_64

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@OTheNonE OTheNonE added bug Something isn't working triage This issue is new labels May 11, 2024
@phughk
Copy link
Contributor

phughk commented May 11, 2024

This should be fixed in 1.5.0 . The beta should already be available.

@phughk phughk removed the triage This issue is new label May 11, 2024
@phughk phughk self-assigned this May 11, 2024
@phughk phughk added this to the v1.5.0-beta.1 milestone May 11, 2024
@OTheNonE
Copy link
Author

OTheNonE commented May 12, 2024

I tried v.1.5.0-beta.1, and it still does not work... Is there any other issue or PR that mentions this error?

@rushmorem rushmorem modified the milestones: v1.5.0-beta.1, v1.5.0 May 13, 2024
@phughk
Copy link
Contributor

phughk commented May 13, 2024

I believed it was part of this
#3946
Will have a look some more thanks

@phughk
Copy link
Contributor

phughk commented May 13, 2024

I remember more context around this. The problem is that when we evaluate the WHERE part of the clause, instead of just resolving the parameter, the entire expression is resolved instead.
I am going to turn this into a feature, as this is a capability we do not support yet.

@phughk phughk changed the title Bug: Live Query using WHERE clause with variables does not work. Feature: Live Query WHERE clause should process Params May 13, 2024
@phughk phughk added feature New feature or request topic:live This is related to live queries and push notifications and removed bug Something isn't working labels May 13, 2024
@rushmorem rushmorem removed this from the v1.5.0 milestone May 14, 2024
@jquesada2016
Copy link

I believe this is a breaking change if it's turned into a feature? This is something that used to work and recently stopped working for me.

@jquesada2016
Copy link

Perhaps in the meantime, could we get documentation to reference that paramters do not currently work, therefore not to rely on them in live query where clauses?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request topic:live This is related to live queries and push notifications
Projects
None yet
Development

No branches or pull requests

4 participants