Issue on GRANT query
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 8.7k
- Forks
- 374
- Avg merge
- 11d 16h
- Merged PRs (30d)
- 1
Description
I'm having trouble running grant queries.
The variables are:
tableArray = ['schema.table1','schema.table2']
roleName = 'example'
This query works fine:
GRANT INSERT ON ${this.sql(tableArray)} TO ${this.sql(roleName)}
the generated query is correct:
GRANT SELECT ON "schema"."table1","schema"."table2" TO "example"
This one doesn't work:
GRANT UPDATE ON ${this.sql(tableArray)} TO ${this.sql(roleName)}
the generated query is invalid:
GRANT UPDATE ON "0"=$1,"1"=$2 TO "example"
Is this a bug in the system that understands what to replace in the query?
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
Start by tracing the sql interpolation behavior for tableArray in the postgres.js query builder, comparing the generated GRANT INSERT and GRANT UPDATE statements shown in the report. Reproduce the example with the two table names and role, then confirm that the UPDATE form generates valid PostgreSQL GRANT SQL rather than the "0"=$1,"1"=$2 output.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100