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

Bug with SQL template variables when action inside while loop #1841

Open
max-ostapenko opened this issue Sep 11, 2024 · 0 comments
Open

Bug with SQL template variables when action inside while loop #1841

max-ostapenko opened this issue Sep 11, 2024 · 0 comments

Comments

@max-ostapenko
Copy link

When iterating an operation over the months I'm using while loop and a dynamic date variable in the SQL template.

I see something strange happens to the iterator variable within the SQL template.

Example:

let i = 0;
while (i <= 1) {
    operate(`while ${i}`).queries(ctx => `
        SELECT '${i}' AS value
    `);

    i++;
}

I get the following compiled SQLs:

  1. Operation "while 0"
SELECT '2' AS value
  1. Operation "while 1"
SELECT '2' AS value
  • forEach and for loops work OK,
  • without ctx => it works OK too.

Originally reported here: https://issuetracker.google.com/issues/365808530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant