Boolean array type inference error
Open
Nobody has claimed this yet.
v4
- Dominant language
- JavaScript
- Stars
- 8.7k
- Forks
- 374
- Avg merge
- 11d 16h
- Merged PRs (30d)
- 1
Description
Boolean array, always passed as a boolean value, here is an example:
await sql`SELECT ${[false, true]} AS bool_array`
// Result(1) [ { bool_array: false } ]
this query is throwing an error
await sql`SELECT ${[true, false]}::bool[]`;
// Error cannot cast type boolean to boolean[]
I think this PR solves this problem
https://github.com/porsager/postgres/pull/392
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the two JavaScript SQL examples from the issue to reproduce the incorrect boolean-array inference and cast error. Review pull request 392 for the proposed direction, then verify that interpolated boolean arrays can be explicitly cast to bool[] and return the expected array result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100