prestodb/presto-go-client

Support for sqlx query parameters.

Closed this issue · 2 comments

Currently, using query parameters in the popular sqlx library will result in an ErrOperationNotSupported due to QueryContext returning the error if it encounters a non-empty args array.

The following arbitrary SQL statements will return ErrOperationNotSupported error:
db.Select(&interface, `SELECT * FROM table WHERE amount > $1`, 100)
or such:
db.Select(&interface, `SELECT * FROM table WHERE amount > ?`, 100)

Is there any plans to implement these operations? This is the relevant section on the sqlx on this functionality.

Correct, it's not supported: https://github.com/prestodb/presto-go-client/blob/master/presto/presto.go#L448

We could support this, but I don't think this is a priority for us at the moment. I'd be happy to review PRs to add this functionality. Should be fairly easy to implement and test.

#29 should give you this. Let us know if you have any troubles.