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

node-postgres can't pass prepared statement parameters for LIMIT or OFFSET for BigQuery #426

Closed
goldmedal opened this issue Jan 11, 2024 · 1 comment

Comments

@goldmedal
Copy link
Collaborator

goldmedal commented Jan 11, 2024

node-postgres will pass all parameter as a VARCHAR data, no matter what type you input.

client.connect()
  .then(() => {
    const query = {
      text: 'SELECT * FROM Model_Ticket LIMIT $1 OFFSET $2',
      values: [100, 50],
    };
    return client.query(query);
  })

However, BigQuery only accepts INTEGER literal for LIMIT or OFFSET statement.

  "message" : "LIMIT expects an integer literal or parameter at [139:7]",
  "status" : "INVALID_ARGUMENT"
@goldmedal
Copy link
Collaborator Author

legacy issue.

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