qb: tuple support

This commit is contained in:
Henrik Johansson
2019-05-13 11:30:19 +02:00
committed by Michal Matczuk
parent 31ae81aba6
commit 219bceab51
9 changed files with 238 additions and 0 deletions

View File

@@ -28,41 +28,81 @@ func TestCmp(t *testing.T) {
S: "lt<?",
N: []string{"lt"},
},
{
C: LtTuple("lt", 2),
S: "lt<(?,?)",
N: []string{"lt"},
},
{
C: LtOrEq("lt"),
S: "lt<=?",
N: []string{"lt"},
},
{
C: LtOrEqTuple("lt", 2),
S: "lt<=(?,?)",
N: []string{"lt"},
},
{
C: Gt("gt"),
S: "gt>?",
N: []string{"gt"},
},
{
C: GtTuple("gt", 2),
S: "gt>(?,?)",
N: []string{"gt"},
},
{
C: GtOrEq("gt"),
S: "gt>=?",
N: []string{"gt"},
},
{
C: GtOrEqTuple("gt", 2),
S: "gt>=(?,?)",
N: []string{"gt"},
},
{
C: In("in"),
S: "in IN ?",
N: []string{"in"},
},
{
C: InTuple("in", 2),
S: "in IN (?,?)",
N: []string{"in"},
},
{
C: Contains("cnt"),
S: "cnt CONTAINS ?",
N: []string{"cnt"},
},
{
C: ContainsTuple("cnt", 2),
S: "cnt CONTAINS (?,?)",
N: []string{"cnt"},
},
{
C: ContainsKey("cntKey"),
S: "cntKey CONTAINS KEY ?",
N: []string{"cntKey"},
},
{
C: ContainsKeyTuple("cntKey", 2),
S: "cntKey CONTAINS KEY (?,?)",
N: []string{"cntKey"},
},
{
C: Like("like"),
S: "like LIKE ?",
N: []string{"like"},
},
{
C: LikeTuple("like", 2),
S: "like LIKE (?,?)",
N: []string{"like"},
},
// Custom bind names
{