The check for named parameters in the bind function might be too restrictive:
main :: IO ()
main = withConnection mempty $ \ connection -> do
result <- query connection "SELECT ?2, ?1, ?2" (16, 42)
print (result :: [(Int, Int, Int)])
This works just fine and prints [(42,16,42)] when the errorCheckParamName check in bind is removed. That is, the variables are bound according to their ?<index> rather than in order of occurrence in the statement.
This would be useful when a value is needed in multiple places in the same query.
The check for named parameters in the
bindfunction might be too restrictive:This works just fine and prints
[(42,16,42)]when theerrorCheckParamNamecheck inbindis removed. That is, the variables are bound according to their?<index>rather than in order of occurrence in the statement.This would be useful when a value is needed in multiple places in the same query.