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

max_page_count pragma doesn't work #1351

Open
akrisfx opened this issue Sep 23, 2024 · 3 comments
Open

max_page_count pragma doesn't work #1351

akrisfx opened this issue Sep 23, 2024 · 3 comments

Comments

@akrisfx
Copy link

akrisfx commented Sep 23, 2024

auto storage = orm::make_storage(
            db_filename, 
            orm::make_table("logs"
                , orm::make_column("id", &log_row::id, orm::primary_key())
                , orm::make_column("log", &log_row::log)
                , orm::make_column("service_name", &log_row::service_name)
            )        
        );
        // storage.sync_schema();
        storage.begin_transaction();
        storage.pragma.max_page_count(30); 
        storage.commit();
        std::cout << storage.pragma.max_page_count() << " |" << std::endl; // I still have the default value here

in the listing above, what with wrapping in commit, what without, I have a default value in the form of 4294967294

if I manually set max_page_count in the sqlite browser (I execute PRAGMA max_page_count = 30;), sqlite_orm still does not see any changes.

@akrisfx
Copy link
Author

akrisfx commented Sep 23, 2024

The funny thing is that I wrote the setter :))

@fnc12
Copy link
Owner

fnc12 commented Sep 23, 2024

@akrisfx how does it work with raw SQLite lib? I bet it works the same. Probably this value is stored within opened connection. If so try to call storage.open_forever right after make_storage and check the result. And you'd add unit test to your PR (my bad I missed it)

@akrisfx
Copy link
Author

akrisfx commented Sep 23, 2024

@fnc12 yes, it's work with opened connection. Thanks
I will write tests little bit later

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

No branches or pull requests

2 participants