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

WHERE with ANY does not work with Params #579

Open
amerryma opened this issue Jun 20, 2022 · 3 comments
Open

WHERE with ANY does not work with Params #579

amerryma opened this issue Jun 20, 2022 · 3 comments

Comments

@amerryma
Copy link

amerryma commented Jun 20, 2022

Right now, the parser sends throws a warning when trying to put a param inside the ANY part of a WHERE clause. Functionally it works great and it seems like the types are correct but I'd like to avoid seeing this warning.

This is the warning:

Parse error: Expect pattern `[a-zA-Z_][a-zA-Z0-9_]*` at (4:22)

    1| SELECT
    2|   *
    3| FROM test
    4| WHERE notnull1 = ANY($1)
                            ^


Due to the problems listed above, the inferred types may be inaccurate with 
respect to nullability.

I wrote a test to hopefully better describe my problem.

--- setup -----------------------------------------------------------------

CREATE TABLE test (
  notnull1 integer
);

--- query -----------------------------------------------------------------

SELECT
  *
FROM test
WHERE notnull1 = ANY(${param})

--- expected row count ----------------------------------------------------

many

--- expected column types -------------------------------------------------

notnull1: number | null

--- expected param types --------------------------------------------------

param: Array<number | null>
@amerryma
Copy link
Author

Is this project inactive and/or looking for new maintainers?

@akheron
Copy link
Owner

akheron commented Jan 24, 2023

Is this project inactive and/or looking for new maintainers?

Well, I guess so. The problem is that I don't currently use it in any of my projects, which makes it harder to find time and motivation to work on it.

@amerryma
Copy link
Author

Definitely understand! I'd be happy to make a PR for this.

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

2 participants