-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to use Pragma with SQLITE? #794
Comments
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? |
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: SQLProvider/tests/SqlProvider.Tests/QueryTests.fs Line 2259 in e1c768a
|
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.
The text was updated successfully, but these errors were encountered: