-
Notifications
You must be signed in to change notification settings - Fork 520
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
Reading the database header #210
Comments
@SRombauts I was thinking of tackling this (as I have done it before in personal projects) - but wanted your thoughts on specific implementation within SQLiteCPP. What do you think of creating a structure to contain the header fields and then having a getHeaderInfo() function within the Database class that returns that struct? |
Hello, I don't have a knowledge of the database header. How do you access it? Edit: I see that you need to read directly the raw file, using something along the line of this: https://stackoverflow.com/questions/18678931/reading-sqlite-header |
Exactly! It's very similar to how you check if the database file is encrypted or not - except we would be parsing the entire header range for all of the different fields. Here is a version I did in C: https://github.com/patrick--/sqlite_header_parse I'll put an implementation / some tests together and submit a PR for your review and we can discuss further. Thanks! |
@SRombauts would you like me to add getHeaderInfo() usage in the |
Hello, yes why not, to end the year well :) |
Closing this since it has been implemented by @patrick-- in #249 Added SQLite header parsing functionality and associated tests |
Why are there no functions for working with the database header?
For instance, it could be useful to get the total number of free list pages (offset 36) to calculate the actual database size before deciding whether to vacuum.
The text was updated successfully, but these errors were encountered: