-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
database/sql
driver: Quote named parameter strings
Fixes a problem reported in #478 in which during a job list, strings aren't properly quoted before being sent to Postgres. This is a bit of an unfortunate problem that stems from the driver being unable to take advantage of Pgx's named parameter system, nor `database/sql`'s `sql.Named` system (because neither Pgx nor `lib/pq` implement it), which required a rough implementation of a custom named parameter system that uses string find/replace. Here, handle a number of possible argument types that `JobList` might support and make sure that the driver sends them to Postgres in an appropriate format, making sure to quote strings and escape subquotes they may have contained. This is all still a little rough and something more robust would definitely be nice, but this should all be input from River's job module, so it doesn't need to have the most robust implementation ever. Fixes #481.
- Loading branch information
Showing
4 changed files
with
213 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters