fnc12 / sqlite_orm

❤️ SQLite ORM light header only library for modern C++
GNU Affero General Public License v3.0
2.19k stars 305 forks source link

PRAGMA options #1299

Closed trevornagy closed 1 month ago

trevornagy commented 1 month ago

I'm just wondering how to use the foreign_keys option, I see it in code but not sure how to enable it. In sqlite it would look like: PRAGMA foreign_keys=ON;

Additionally, would it be possible to get the recursive_triggers option? In sqlite: PRAGMA recursive_triggers=ON;

Thanks!

fnc12 commented 1 month ago

1) foreign_keys is enabled by storage after every SQLite connection is opened if make_table contains at least 1 foreign key; 2) recursive_triggers will be added soon.

fnc12 commented 1 month ago

PR with recursive_triggers https://github.com/fnc12/sqlite_orm/pull/1302

trevornagy commented 1 month ago

Awesome, thank you!

I appreciate the clarification on foreign_keys

fnc12 commented 1 month ago

@trevornagy merged. Please check dev branch

juandent commented 1 month ago

This should be possible to allow change in data or structure We go back to a touchy subject but I think we should enable this in a safe manner and being very careful to explain the dangers of it’s unscrupulous useMaybe allow it in sync_schema and disable it afterwardsRegards Juan DentSent from my iPhoneOn 29 May 2024, at 8:44 AM, Yevgeniy Zakharov @.***> wrote: PR with recursive_triggers #1302

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

trevornagy commented 1 month ago

Works as expected, thanks!