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

Support pragma statements that return results #1106

Closed
AlecKazakova opened this issue Dec 29, 2018 · 3 comments · Fixed by #3054
Closed

Support pragma statements that return results #1106

AlecKazakova opened this issue Dec 29, 2018 · 3 comments · Fixed by #3054
Labels
component: compiler component: sql-psi Should be implemented in https://github.com/AlecStrong/sql-psi enhancement
Milestone

Comments

@AlecKazakova
Copy link
Collaborator

https://www.sqlite.org/pragma.html

@ScottPierce
Copy link

This would be nice.

@AlecKazakova AlecKazakova added component: compiler enhancement component: sql-psi Should be implemented in https://github.com/AlecStrong/sql-psi labels Jan 12, 2019
@melnikovdv
Copy link

melnikovdv commented Feb 16, 2020

Is it safe to do pragma requests this way until the issue is complete?

val driver = JdbcSqliteDriver("jdbc:sqlite:temp.db")
driver.execute(null, "PRAGMA user_version = 2;", 0, null)
val sqlCursor = driver.executeQuery(null, "PRAGMA user_version;", 0, null)
val userVersion = sqlCursor.getLong(0)!!

And as issue title is about statements that return results how to execute pragma statements that don't return results?

@treitter
Copy link

treitter commented Jul 8, 2021

I'd also like to be able to fetch PRAGMA user_version via labeled SQL statement like:

getVersion:
PRAGMA user_version;

I'd already been using this PRAGMA value in a SQLite DB that I'm migrating to use from SQLDelight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: compiler component: sql-psi Should be implemented in https://github.com/AlecStrong/sql-psi enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants