Open OnurGumus opened 1 year ago
As SQLite doesn't support stored procedures and the features was already there, you can do pragma via them: https://fsprojects.github.io/SQLProvider/core/programmability.html
As in test-project:
let dc = sql.GetDataContext()
let pragmaSchemav = dc.Pragma.Get.Invoke("schema_version")
let res = pragmaSchemav.ResultSet |> Array.map(fun i -> i.ColumnValues |> Map.ofSeq)
let ver = (res |> Seq.head).["schema_version"] :?> Int64
let pragmaFk = dc.Pragma.GetOf.Invoke("foreign_key_list", "EmployeesTerritories")
let res = pragmaFk.ResultSet |> Array.map(fun i -> i.ColumnValues |> Map.ofSeq)
In particular I'd like to set busy_timeout per connection. How can I do it?
as in
PRAGMA busy_timeout
What happens if you do this: dc.Pragma.Get.Invoke("busy_timeout=300")
@Thorium, Invoke doesn't take any parameter with sqlite, not for get not for getof.
That's a bit weird because I took my code line from the test-project:
When you use pragma statements with sqlite, you need to do it at the beginning of your connection. I am not sure how this is achievable with SqlProvider, any hints appreciated.