Add qb.ContainsKey to query keys in a map (#57)

qb: add ContainsKey and ContainsKeyNamed
This commit is contained in:
Vincent Rischmann
2018-07-28 06:56:44 +02:00
committed by Michał Matczuk
parent 9b530002fa
commit 2f13a81c46
2 changed files with 31 additions and 0 deletions

View File

@@ -53,6 +53,11 @@ func TestCmp(t *testing.T) {
S: "cnt CONTAINS ?",
N: []string{"cnt"},
},
{
C: ContainsKey("cntKey"),
S: "cntKey CONTAINS KEY ?",
N: []string{"cntKey"},
},
// Custom bind names
{
@@ -90,6 +95,11 @@ func TestCmp(t *testing.T) {
S: "cnt CONTAINS ?",
N: []string{"name"},
},
{
C: ContainsKeyNamed("cntKey", "name"),
S: "cntKey CONTAINS KEY ?",
N: []string{"name"},
},
// Literals
{