-
Notifications
You must be signed in to change notification settings - Fork 203
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
Updated the methods for pragma calls according to the currently #136
Conversation
@aibor thank you for the pull. Can you tell us if there is a minimum version requirement with those new pragmas? |
The complete set of pragmas onlyworks in recent versions. However, with older versions the then umimplemented pragmas just return nothing. So backwards compatibility is given. I don't know if it is a good idea to alias these old pragma names to the new names. That might be a good idea to prevent NoMethodErrors for code which has these methods still implemented, although they haven't done anything for years now. Edit: |
After further investigating the commit history I can now tell that SQLite 3.4.0 is the minimum version for this changes to work. I have added some pragmas again for backwards compatibility. The only thing that has changed its functionality instead of just dis-/appearing is the auto_vacuum pragma, which has changed from a boolean value to enum value with version 3.4.0. |
Honestly I'm not a huge fan of supporting all of these since they change from version to version. It means we have to keep updating them as upstream adds more. Could we consider just providing methods to get and set pragmas, and people can pass in the pragma name they care about? Then we don't have to keep updating this stuff and I think it would be more clear to the user, and they can manipulate pragmas without waiting for us to upgrade our API. |
I absolutely agree that keeping the pragma methods up to date is tedious. As the different pragma type getter and setter methods are already there, it might be desirable to make them public. So if one of the wrappers is outdated because the usage has changed or new pragmas have been added, anyone can use the generic getters and setters for these pragmas. |
I agree.
I agree with this as well. Can you change the PR to just make those getter / setter methods public? |
Updated the methods for pragma calls according to the currently supported pragmas listed on https://sqlite.org/pragma.html. The previous behaviour is maintained and extended by the new pragmas. Only thing changed is the auto_vacuum pragma, which has changed in the commit from 2007-04-26: https://www.sqlite.org/cgi/src/info/f6a6d2b8872c05089810b1e095f39011f3035408 So, the minimal version for this to work is SQLite 3.4.0
As discussed in #136, the type-based getter and setter helper methods for pragmas are public now. This allows direct usage in case there are no specific methods for a pragma.
Type based getters/setters have been made public with ae6c84a. I have also added methods for recently added pragmas. In order to keep the keep it tidy I have squashed the commits regarding these wrapper methods into ee010db, which is based on current master, now. I'm sorry for the mess, but I hope this will keep the commit log sane. |
@aibor great, thank you! |
Updated the methods for pragma calls according to the currently
Some of the pragmas called in the Pragmas module were deprecated and new ones were missing.
So I updated the methods for pragma calls according to the currently supported pragmas listed on https://sqlite.org/pragma.html
This should fix #120