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

Uncaught Kotlin exception: com.ctrip.sqllin.driver.SQLiteResultCode: error rawExecSql: PRAGMA user_version = 1;, attempt to write a readonly database | error code SQLITE_READONLY #53

Closed
nbransby opened this issue Oct 18, 2023 · 8 comments

Comments

@nbransby
Copy link
Contributor

Got a new issue now - are you calling PRAGMA user_version = 1 internally in SQLlin somewhere?

@nbransby
Copy link
Contributor Author

And then thrown from here

@qiaoyuang
Copy link
Collaborator

Okay, I will look at this issue today.

@qiaoyuang
Copy link
Collaborator

I think this is a reasonable behavior. If users use read-only mode, they should ensure the value of DatabaseConfiguration.version same with the value in database file. So, I would add a separate check for this situation and throw an IllegalArgumentException with the related message.

@nbransby
Copy link
Contributor Author

Does that number have to be greater than 0?

@qiaoyuang
Copy link
Collaborator

Yes, if we create a new database, usually set the version is 1.

@nbransby
Copy link
Contributor Author

OK great thanks

@qiaoyuang
Copy link
Collaborator

You're welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants