Skip to content
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

Getting a pragma value #79

Closed
adamnemecek opened this issue May 16, 2022 · 2 comments
Closed

Getting a pragma value #79

adamnemecek opened this issue May 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@adamnemecek
Copy link

adamnemecek commented May 16, 2022

I'm having a hard time figuring out how to get a pragma value out of SQLite using Fluent. Any pointers?

@adamnemecek adamnemecek added the bug Something isn't working label May 16, 2022
@0xTim
Copy link
Member

0xTim commented May 16, 2022

@adamnemecek was this solved in Discord?

@gwynne
Copy link
Member

gwynne commented Oct 19, 2023

try await (req.db as! any SQLDatabase).raw("PRAGMA some_pragma_or_other").first()?.decode(column: "some_pragma_or_other", as: Int.self)

See also https://github.com/vapor/sqlite-kit/blob/main/Tests/SQLiteKitTests/SQLiteKitTests.swift#L92-L93

@gwynne gwynne closed this as completed Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants