-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Hi again! I have a use case that isn't directly related to pg-mem as it is, but could be useful.
We're using AWS's RDS data api to query postgres. We use the data-api-client library, which means there are some query-parsing tools relying on pgsql-ast-parser we can't use anymore because of the variable format it uses:
let resultParams = await data.query(
`SELECT * FROM myTable WHERE id = :id`,
{ id: 2 }
)These kinds of queries result in a parse error with the current library - this makes sense, since it's not valid SQL syntax. But it'd be great if we could add an option to be able to parse it and extract the variable names (in the example above, maybe the where would become something like { type: 'parameter', name: ':id' }). It'd allow statically inspecting sql queries and doing things like formatting, linting, type generation.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed