First cut of BT operator (#3)
This commit is contained in:
@@ -28,6 +28,9 @@ let all =
|
||||
test "NE succeeds" {
|
||||
Expect.equal (string NE) "<>" "The not equal to operator was not correct"
|
||||
}
|
||||
test "BT succeeds" {
|
||||
Expect.equal (string BT) "BETWEEN" """The "between" operator was not correct"""
|
||||
}
|
||||
test "EX succeeds" {
|
||||
Expect.equal (string EX) "IS NOT NULL" """The "exists" operator was not correct"""
|
||||
}
|
||||
@@ -35,27 +38,64 @@ let all =
|
||||
Expect.equal (string NEX) "IS NULL" """The "not exists" operator was not correct"""
|
||||
}
|
||||
]
|
||||
testList "Field" [
|
||||
test "EQ succeeds" {
|
||||
let field = Field.EQ "Test" 14
|
||||
Expect.equal field.Name "Test" "Field name incorrect"
|
||||
Expect.equal field.Op EQ "Operator incorrect"
|
||||
Expect.equal field.Value 14 "Value incorrect"
|
||||
}
|
||||
test "GT succeeds" {
|
||||
let field = Field.GT "Great" "night"
|
||||
Expect.equal field.Name "Great" "Field name incorrect"
|
||||
Expect.equal field.Op GT "Operator incorrect"
|
||||
Expect.equal field.Value "night" "Value incorrect"
|
||||
}
|
||||
test "GE succeeds" {
|
||||
let field = Field.GE "Nice" 88L
|
||||
Expect.equal field.Name "Nice" "Field name incorrect"
|
||||
Expect.equal field.Op GE "Operator incorrect"
|
||||
Expect.equal field.Value 88L "Value incorrect"
|
||||
}
|
||||
test "LT succeeds" {
|
||||
let field = Field.LT "Lesser" "seven"
|
||||
Expect.equal field.Name "Lesser" "Field name incorrect"
|
||||
Expect.equal field.Op LT "Operator incorrect"
|
||||
Expect.equal field.Value "seven" "Value incorrect"
|
||||
}
|
||||
test "LE succeeds" {
|
||||
let field = Field.LE "Nobody" "KNOWS";
|
||||
Expect.equal field.Name "Nobody" "Field name incorrect"
|
||||
Expect.equal field.Op LE "Operator incorrect"
|
||||
Expect.equal field.Value "KNOWS" "Value incorrect"
|
||||
}
|
||||
test "NE succeeds" {
|
||||
let field = Field.NE "Park" "here"
|
||||
Expect.equal field.Name "Park" "Field name incorrect"
|
||||
Expect.equal field.Op NE "Operator incorrect"
|
||||
Expect.equal field.Value "here" "Value incorrect"
|
||||
}
|
||||
test "BT succeeds" {
|
||||
let field = Field.BT "Age" 18 49
|
||||
Expect.equal field.Name "Age" "Field name incorrect"
|
||||
Expect.equal field.Op BT "Operator incorrect"
|
||||
Expect.sequenceEqual (field.Value :?> obj list) [ 18; 49 ] "Value incorrect"
|
||||
}
|
||||
test "EX succeeds" {
|
||||
let field = Field.EX "Groovy"
|
||||
Expect.equal field.Name "Groovy" "Field name incorrect"
|
||||
Expect.equal field.Op EX "Operator incorrect"
|
||||
}
|
||||
test "NEX succeeds" {
|
||||
let field = Field.NEX "Rad"
|
||||
Expect.equal field.Name "Rad" "Field name incorrect"
|
||||
Expect.equal field.Op NEX "Operator incorrect"
|
||||
}
|
||||
]
|
||||
testList "Query" [
|
||||
test "selectFromTable succeeds" {
|
||||
Expect.equal (Query.selectFromTable tbl) $"SELECT data FROM {tbl}" "SELECT statement not correct"
|
||||
}
|
||||
test "whereById succeeds" {
|
||||
Expect.equal (Query.whereById "@id") "data ->> 'Id' = @id" "WHERE clause not correct"
|
||||
}
|
||||
testList "whereByField" [
|
||||
test "succeeds when a logical operator is passed" {
|
||||
Expect.equal
|
||||
(Query.whereByField (Field.GT "theField" 0) "@test")
|
||||
"data ->> 'theField' > @test"
|
||||
"WHERE clause not correct"
|
||||
}
|
||||
test "succeeds when an existence operator is passed" {
|
||||
Expect.equal
|
||||
(Query.whereByField (Field.NEX "thatField") "")
|
||||
"data ->> 'thatField' IS NULL"
|
||||
"WHERE clause not correct"
|
||||
}
|
||||
]
|
||||
testList "Definition" [
|
||||
test "ensureTableFor succeeds" {
|
||||
Expect.equal
|
||||
@@ -92,68 +132,9 @@ let all =
|
||||
test "save succeeds" {
|
||||
Expect.equal
|
||||
(Query.save tbl)
|
||||
$"INSERT INTO {tbl} VALUES (@data) ON CONFLICT ((data ->> 'Id')) DO UPDATE SET data = EXCLUDED.data"
|
||||
$"INSERT INTO {tbl} VALUES (@data) ON CONFLICT ((data->>'Id')) DO UPDATE SET data = EXCLUDED.data"
|
||||
"INSERT ON CONFLICT UPDATE statement not correct"
|
||||
}
|
||||
test "update succeeds" {
|
||||
Expect.equal
|
||||
(Query.update tbl)
|
||||
$"UPDATE {tbl} SET data = @data WHERE data ->> 'Id' = @id"
|
||||
"UPDATE full statement not correct"
|
||||
}
|
||||
testList "Count" [
|
||||
test "all succeeds" {
|
||||
Expect.equal (Query.Count.all tbl) $"SELECT COUNT(*) AS it FROM {tbl}" "Count query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Count.byField tbl (Field.EQ "thatField" 0))
|
||||
$"SELECT COUNT(*) AS it FROM {tbl} WHERE data ->> 'thatField' = @field"
|
||||
"JSON field text comparison count query not correct"
|
||||
}
|
||||
]
|
||||
testList "Exists" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Exists.byId tbl)
|
||||
$"SELECT EXISTS (SELECT 1 FROM {tbl} WHERE data ->> 'Id' = @id) AS it"
|
||||
"ID existence query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Exists.byField tbl (Field.LT "Test" 0))
|
||||
$"SELECT EXISTS (SELECT 1 FROM {tbl} WHERE data ->> 'Test' < @field) AS it"
|
||||
"JSON field text comparison exists query not correct"
|
||||
}
|
||||
]
|
||||
testList "Find" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Find.byId tbl)
|
||||
$"SELECT data FROM {tbl} WHERE data ->> 'Id' = @id"
|
||||
"SELECT by ID query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Find.byField tbl (Field.GE "Golf" 0))
|
||||
$"SELECT data FROM {tbl} WHERE data ->> 'Golf' >= @field"
|
||||
"SELECT by JSON comparison query not correct"
|
||||
}
|
||||
]
|
||||
testList "Delete" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Delete.byId tbl)
|
||||
$"DELETE FROM {tbl} WHERE data ->> 'Id' = @id"
|
||||
"DELETE by ID query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Delete.byField tbl (Field.NEX "gone"))
|
||||
$"DELETE FROM {tbl} WHERE data ->> 'gone' IS NULL"
|
||||
"DELETE by JSON comparison query not correct"
|
||||
}
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@@ -34,12 +34,59 @@ let unitTests =
|
||||
let paramList = addFieldParam "@field" (Field.EX "tacos") []
|
||||
Expect.isEmpty paramList "There should not have been any parameters added"
|
||||
}
|
||||
test "succeeds when two parameters are added" {
|
||||
let paramList = addFieldParam "@field" (Field.BT "that" "eh" "zed") []
|
||||
Expect.hasLength paramList 2 "There should have been 2 parameters added"
|
||||
let min = paramList[0]
|
||||
Expect.equal (fst min) "@fieldmin" "Minimum field name not correct"
|
||||
match snd min with
|
||||
| SqlValue.Parameter value ->
|
||||
Expect.equal value.ParameterName "@fieldmin" "Minimum parameter name not correct"
|
||||
Expect.equal value.Value "eh" "Minimum parameter value not correct"
|
||||
| _ -> Expect.isTrue false "Minimum parameter was not a Parameter type"
|
||||
let max = paramList[1]
|
||||
Expect.equal (fst max) "@fieldmax" "Maximum field name not correct"
|
||||
match snd max with
|
||||
| SqlValue.Parameter value ->
|
||||
Expect.equal value.ParameterName "@fieldmax" "Maximum parameter name not correct"
|
||||
Expect.equal value.Value "zed" "Maximum parameter value not correct"
|
||||
| _ -> Expect.isTrue false "Maximum parameter was not a Parameter type"
|
||||
}
|
||||
]
|
||||
test "noParams succeeds" {
|
||||
Expect.isEmpty noParams "The no-params sequence should be empty"
|
||||
}
|
||||
]
|
||||
testList "Query" [
|
||||
testList "whereByField" [
|
||||
test "succeeds when a logical operator is passed" {
|
||||
Expect.equal
|
||||
(Query.whereByField (Field.GT "theField" 0) "@test")
|
||||
"data->>'theField' > @test"
|
||||
"WHERE clause not correct"
|
||||
}
|
||||
test "succeeds when an existence operator is passed" {
|
||||
Expect.equal
|
||||
(Query.whereByField (Field.NEX "thatField") "")
|
||||
"data->>'thatField' IS NULL"
|
||||
"WHERE clause not correct"
|
||||
}
|
||||
test "succeeds when a between operator is passed with numeric values" {
|
||||
Expect.equal
|
||||
(Query.whereByField (Field.BT "aField" 50 99) "@range")
|
||||
"(data->>'aField')::numeric BETWEEN @rangemin AND @rangemax"
|
||||
"WHERE clause not correct"
|
||||
}
|
||||
test "succeeds when a between operator is passed with non-numeric values" {
|
||||
Expect.equal
|
||||
(Query.whereByField (Field.BT "field0" "a" "b") "@alpha")
|
||||
"data->>'field0' BETWEEN @alphamin AND @alphamax"
|
||||
"WHERE clause not correct"
|
||||
}
|
||||
]
|
||||
test "whereById succeeds" {
|
||||
Expect.equal (Query.whereById "@id") "data->>'Id' = @id" "WHERE clause not correct"
|
||||
}
|
||||
testList "Definition" [
|
||||
test "ensureTable succeeds" {
|
||||
Expect.equal
|
||||
@@ -61,6 +108,12 @@ let unitTests =
|
||||
"CREATE INDEX statement not constructed correctly"
|
||||
}
|
||||
]
|
||||
test "update succeeds" {
|
||||
Expect.equal
|
||||
(Query.update PostgresDb.TableName)
|
||||
$"UPDATE {PostgresDb.TableName} SET data = @data WHERE data->>'Id' = @id"
|
||||
"UPDATE full statement not correct"
|
||||
}
|
||||
test "whereDataContains succeeds" {
|
||||
Expect.equal (Query.whereDataContains "@test") "data @> @test" "WHERE clause not correct"
|
||||
}
|
||||
@@ -68,6 +121,18 @@ let unitTests =
|
||||
Expect.equal (Query.whereJsonPathMatches "@path") "data @? @path::jsonpath" "WHERE clause not correct"
|
||||
}
|
||||
testList "Count" [
|
||||
test "all succeeds" {
|
||||
Expect.equal
|
||||
(Query.Count.all PostgresDb.TableName)
|
||||
$"SELECT COUNT(*) AS it FROM {PostgresDb.TableName}"
|
||||
"Count query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Count.byField PostgresDb.TableName (Field.EQ "thatField" 0))
|
||||
$"SELECT COUNT(*) AS it FROM {PostgresDb.TableName} WHERE data->>'thatField' = @field"
|
||||
"JSON field text comparison count query not correct"
|
||||
}
|
||||
test "byContains succeeds" {
|
||||
Expect.equal
|
||||
(Query.Count.byContains PostgresDb.TableName)
|
||||
@@ -82,6 +147,18 @@ let unitTests =
|
||||
}
|
||||
]
|
||||
testList "Exists" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Exists.byId PostgresDb.TableName)
|
||||
$"SELECT EXISTS (SELECT 1 FROM {PostgresDb.TableName} WHERE data->>'Id' = @id) AS it"
|
||||
"ID existence query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Exists.byField PostgresDb.TableName (Field.LT "Test" 0))
|
||||
$"SELECT EXISTS (SELECT 1 FROM {PostgresDb.TableName} WHERE data->>'Test' < @field) AS it"
|
||||
"JSON field text comparison exists query not correct"
|
||||
}
|
||||
test "byContains succeeds" {
|
||||
Expect.equal
|
||||
(Query.Exists.byContains PostgresDb.TableName)
|
||||
@@ -96,6 +173,18 @@ let unitTests =
|
||||
}
|
||||
]
|
||||
testList "Find" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Find.byId PostgresDb.TableName)
|
||||
$"SELECT data FROM {PostgresDb.TableName} WHERE data->>'Id' = @id"
|
||||
"SELECT by ID query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Find.byField PostgresDb.TableName (Field.GE "Golf" 0))
|
||||
$"SELECT data FROM {PostgresDb.TableName} WHERE data->>'Golf' >= @field"
|
||||
"SELECT by JSON comparison query not correct"
|
||||
}
|
||||
test "byContains succeeds" {
|
||||
Expect.equal
|
||||
(Query.Find.byContains PostgresDb.TableName)
|
||||
@@ -113,13 +202,13 @@ let unitTests =
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Patch.byId PostgresDb.TableName)
|
||||
$"UPDATE {PostgresDb.TableName} SET data = data || @data WHERE data ->> 'Id' = @id"
|
||||
$"UPDATE {PostgresDb.TableName} SET data = data || @data WHERE data->>'Id' = @id"
|
||||
"UPDATE partial by ID statement not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Patch.byField PostgresDb.TableName (Field.LT "Snail" 0))
|
||||
$"UPDATE {PostgresDb.TableName} SET data = data || @data WHERE data ->> 'Snail' < @field"
|
||||
$"UPDATE {PostgresDb.TableName} SET data = data || @data WHERE data->>'Snail' < @field"
|
||||
"UPDATE partial by ID statement not correct"
|
||||
}
|
||||
test "byContains succeeds" {
|
||||
@@ -139,13 +228,13 @@ let unitTests =
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.RemoveFields.byId "tbl")
|
||||
"UPDATE tbl SET data = data - @name WHERE data ->> 'Id' = @id"
|
||||
"UPDATE tbl SET data = data - @name WHERE data->>'Id' = @id"
|
||||
"Remove field by ID query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.RemoveFields.byField "tbl" (Field.LT "Fly" 0))
|
||||
"UPDATE tbl SET data = data - @name WHERE data ->> 'Fly' < @field"
|
||||
"UPDATE tbl SET data = data - @name WHERE data->>'Fly' < @field"
|
||||
"Remove field by field query not correct"
|
||||
}
|
||||
test "byContains succeeds" {
|
||||
@@ -162,6 +251,18 @@ let unitTests =
|
||||
}
|
||||
]
|
||||
testList "Delete" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Delete.byId PostgresDb.TableName)
|
||||
$"DELETE FROM {PostgresDb.TableName} WHERE data->>'Id' = @id"
|
||||
"DELETE by ID query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Delete.byField PostgresDb.TableName (Field.NEX "gone"))
|
||||
$"DELETE FROM {PostgresDb.TableName} WHERE data->>'gone' IS NULL"
|
||||
"DELETE by JSON comparison query not correct"
|
||||
}
|
||||
test "byContains succeeds" {
|
||||
Expect.equal (Query.Delete.byContains PostgresDb.TableName)
|
||||
$"DELETE FROM {PostgresDb.TableName} WHERE data @> @criteria"
|
||||
@@ -391,8 +492,8 @@ let integrationTests =
|
||||
use db = PostgresDb.BuildDb()
|
||||
do! loadDocs ()
|
||||
|
||||
let! theCount = Count.byField PostgresDb.TableName (Field.EQ "Value" "purple")
|
||||
Expect.equal theCount 2 "There should have been 2 matching documents"
|
||||
let! theCount = Count.byField PostgresDb.TableName (Field.BT "NumValue" 10 20)
|
||||
Expect.equal theCount 3 "There should have been 3 matching documents"
|
||||
}
|
||||
testTask "byContains succeeds" {
|
||||
use db = PostgresDb.BuildDb()
|
||||
|
||||
@@ -12,23 +12,91 @@ open Types
|
||||
let unitTests =
|
||||
testList "Unit" [
|
||||
testList "Query" [
|
||||
testList "whereByField" [
|
||||
test "succeeds when a logical operator is passed" {
|
||||
Expect.equal
|
||||
(Query.whereByField (Field.GT "theField" 0) "@test")
|
||||
"data->>'theField' > @test"
|
||||
"WHERE clause not correct"
|
||||
}
|
||||
test "succeeds when an existence operator is passed" {
|
||||
Expect.equal
|
||||
(Query.whereByField (Field.NEX "thatField") "")
|
||||
"data->>'thatField' IS NULL"
|
||||
"WHERE clause not correct"
|
||||
}
|
||||
test "succeeds when the between operator is passed" {
|
||||
Expect.equal
|
||||
(Query.whereByField (Field.BT "aField" 50 99) "@range")
|
||||
"data->>'aField' BETWEEN @rangemin AND @rangemax"
|
||||
"WHERE clause not correct"
|
||||
}
|
||||
]
|
||||
test "whereById succeeds" {
|
||||
Expect.equal (Query.whereById "@id") "data->>'Id' = @id" "WHERE clause not correct"
|
||||
}
|
||||
test "Definition.ensureTable succeeds" {
|
||||
Expect.equal
|
||||
(Query.Definition.ensureTable "tbl")
|
||||
"CREATE TABLE IF NOT EXISTS tbl (data TEXT NOT NULL)"
|
||||
"CREATE TABLE statement not correct"
|
||||
}
|
||||
test "update succeeds" {
|
||||
Expect.equal
|
||||
(Query.update "tbl")
|
||||
"UPDATE tbl SET data = @data WHERE data->>'Id' = @id"
|
||||
"UPDATE full statement not correct"
|
||||
}
|
||||
testList "Count" [
|
||||
test "all succeeds" {
|
||||
Expect.equal (Query.Count.all "tbl") $"SELECT COUNT(*) AS it FROM tbl" "Count query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Count.byField "tbl" (Field.EQ "thatField" 0))
|
||||
"SELECT COUNT(*) AS it FROM tbl WHERE data->>'thatField' = @field"
|
||||
"JSON field text comparison count query not correct"
|
||||
}
|
||||
]
|
||||
testList "Exists" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Exists.byId "tbl")
|
||||
"SELECT EXISTS (SELECT 1 FROM tbl WHERE data->>'Id' = @id) AS it"
|
||||
"ID existence query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Exists.byField "tbl" (Field.LT "Test" 0))
|
||||
"SELECT EXISTS (SELECT 1 FROM tbl WHERE data->>'Test' < @field) AS it"
|
||||
"JSON field text comparison exists query not correct"
|
||||
}
|
||||
]
|
||||
testList "Find" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Find.byId "tbl")
|
||||
"SELECT data FROM tbl WHERE data->>'Id' = @id"
|
||||
"SELECT by ID query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Find.byField "tbl" (Field.GE "Golf" 0))
|
||||
"SELECT data FROM tbl WHERE data->>'Golf' >= @field"
|
||||
"SELECT by JSON comparison query not correct"
|
||||
}
|
||||
]
|
||||
testList "Patch" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Patch.byId "tbl")
|
||||
"UPDATE tbl SET data = json_patch(data, json(@data)) WHERE data ->> 'Id' = @id"
|
||||
"UPDATE tbl SET data = json_patch(data, json(@data)) WHERE data->>'Id' = @id"
|
||||
"UPDATE partial by ID statement not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Patch.byField "tbl" (Field.NE "Part" 0))
|
||||
"UPDATE tbl SET data = json_patch(data, json(@data)) WHERE data ->> 'Part' <> @field"
|
||||
"UPDATE tbl SET data = json_patch(data, json(@data)) WHERE data->>'Part' <> @field"
|
||||
"UPDATE partial by JSON comparison query not correct"
|
||||
}
|
||||
]
|
||||
@@ -36,7 +104,7 @@ let unitTests =
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.RemoveFields.byId "tbl" [ SqliteParameter("@name", "one") ])
|
||||
"UPDATE tbl SET data = json_remove(data, @name) WHERE data ->> 'Id' = @id"
|
||||
"UPDATE tbl SET data = json_remove(data, @name) WHERE data->>'Id' = @id"
|
||||
"Remove field by ID query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
@@ -45,10 +113,24 @@ let unitTests =
|
||||
"tbl"
|
||||
(Field.GT "Fly" 0)
|
||||
[ SqliteParameter("@name0", "one"); SqliteParameter("@name1", "two") ])
|
||||
"UPDATE tbl SET data = json_remove(data, @name0, @name1) WHERE data ->> 'Fly' > @field"
|
||||
"UPDATE tbl SET data = json_remove(data, @name0, @name1) WHERE data->>'Fly' > @field"
|
||||
"Remove field by field query not correct"
|
||||
}
|
||||
]
|
||||
testList "Delete" [
|
||||
test "byId succeeds" {
|
||||
Expect.equal
|
||||
(Query.Delete.byId "tbl")
|
||||
"DELETE FROM tbl WHERE data->>'Id' = @id"
|
||||
"DELETE by ID query not correct"
|
||||
}
|
||||
test "byField succeeds" {
|
||||
Expect.equal
|
||||
(Query.Delete.byField "tbl" (Field.NEX "gone"))
|
||||
"DELETE FROM tbl WHERE data->>'gone' IS NULL"
|
||||
"DELETE by JSON comparison query not correct"
|
||||
}
|
||||
]
|
||||
]
|
||||
testList "Parameters" [
|
||||
test "idParam succeeds" {
|
||||
@@ -303,8 +385,8 @@ let integrationTests =
|
||||
use! db = SqliteDb.BuildDb()
|
||||
do! loadDocs ()
|
||||
|
||||
let! theCount = Count.byField SqliteDb.TableName (Field.EQ "Value" "purple")
|
||||
Expect.equal theCount 2L "There should have been 2 matching documents"
|
||||
let! theCount = Count.byField SqliteDb.TableName (Field.BT "NumValue" 10 20)
|
||||
Expect.equal theCount 3L "There should have been 3 matching documents"
|
||||
}
|
||||
]
|
||||
testList "Exists" [
|
||||
|
||||
Reference in New Issue
Block a user