Skip to content

Commit

Permalink
fix up colon test, add documentation for skipping it
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoiron committed Jan 24, 2021
1 parent 0a02cfe commit 917b018
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions named_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ func (t Test) Errorf(err error, format string, args ...interface{}) {
}

func TestEscapedColons(t *testing.T) {
t.Skip("not sure it is possible to support this in general case without an SQL parser")
var qs = `SELECT * FROM testtable WHERE timeposted BETWEEN (now() AT TIME ZONE 'utc') AND
(now() AT TIME ZONE 'utc') - interval '01:30:00') AND name = '\'this is a test\'' and id = :id`
_, _, err := compileNamedQuery([]byte(qs), 3) //3 being DOLLAR
if err != nil{
_, _, err := compileNamedQuery([]byte(qs), DOLLAR)
if err != nil {
t.Error("Didn't handle colons correctly when inside a string")
}
}
Expand Down

0 comments on commit 917b018

Please sign in to comment.