Spell out field names
This commit is contained in:
@@ -101,7 +101,7 @@ module Parameters =
|
||||
let paramName = $"{p}_{idx}"
|
||||
paramName, Sql.parameter (NpgsqlParameter(paramName, v)))
|
||||
| Contains _ -> () // TODO
|
||||
| Equals v | Greater v | GreaterOrEqual v | Less v | LessOrEqual v | NotEqual v ->
|
||||
| Equal v | Greater v | GreaterOrEqual v | Less v | LessOrEqual v | NotEqual v ->
|
||||
let p = name.Derive it.ParameterName
|
||||
yield (p, parameterFor v (fun l -> Sql.parameter (NpgsqlParameter(p, l)))) })
|
||||
|> Seq.collect id
|
||||
@@ -147,7 +147,7 @@ module Query =
|
||||
let paramNames = values |> Seq.mapi (fun idx _ -> $"{p}_{idx}") |> String.concat ", "
|
||||
$"({paramNames})", defaultArg (Seq.tryHead values) (obj ())
|
||||
| Contains _ -> p, "" // TODO: may need to use -> vs ->> in field SQL
|
||||
| Equals v | Greater v | GreaterOrEqual v | Less v | LessOrEqual v | NotEqual v -> p, v
|
||||
| Equal v | Greater v | GreaterOrEqual v | Less v | LessOrEqual v | NotEqual v -> p, v
|
||||
| _ -> p, ""
|
||||
if isNumeric value then
|
||||
$"({it.Path PostgreSQL})::numeric {it.Comparison.OpSql} {param}"
|
||||
@@ -157,7 +157,7 @@ module Query =
|
||||
/// Create a WHERE clause fragment to implement an ID-based query
|
||||
[<CompiledName "WhereById">]
|
||||
let whereById<'TKey> (docId: 'TKey) =
|
||||
whereByFields Any [ { Field.EQ (Configuration.idField ()) docId with ParameterName = Some "@id" } ]
|
||||
whereByFields Any [ { Field.Equal (Configuration.idField ()) docId with ParameterName = Some "@id" } ]
|
||||
|
||||
/// Table and index definition queries
|
||||
module Definition =
|
||||
|
||||
Reference in New Issue
Block a user