Skip to content

sqlc.arg clashing with reserved keywords #3867

Open
@konstantinB1

Description

@konstantinB1

What do you want to change?

When using reserved keywords inside sqlc.arg, like:

...
LIMIT sqlc.arg(limit)::int OFFSET sqlc.arg(offset)::int;

It is throwing an invalid error synthax, because limit, and offset are exclusive and reserved to database syntax (in my case POSTGRES).

Proposal

Either parse a sqlc.arg argument as a String synthax, and treat arguments wrapped with String notation as a literal, OR make parameter args unreserved.
Not sure is this a simple task, since you would probably have to "clean up" arguments, then parse/verify the query validity, and then reinject the args, in order for it to work. Not sure how internals parse it.

If its too much hassle just close it, would be nice tho if i could have nice intention in params to know what the param is about. But not a big deal really.

What database engines need to be changed?

This is not exclusive to Postgres, probably every SQL based distro

What programming language backends need to be changed?

Golang

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions