Skip to content

Turn on recursive_triggers by default #152

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

Closed
simonw opened this issue Sep 7, 2020 · 2 comments
Closed

Turn on recursive_triggers by default #152

simonw opened this issue Sep 7, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Sep 7, 2020

https://www.sqlite.org/pragma.html#pragma_recursive_triggers says:

Prior to SQLite version 3.6.18 (2009-09-11), recursive triggers were not supported. The behavior of SQLite was always as if this pragma was set to OFF. Support for recursive triggers was added in version 3.6.18 but was initially turned OFF by default, for compatibility. Recursive triggers may be turned on by default in future versions of SQLite.

So I think the fix for the complex issue in #149 is to turn on recursive_triggers globally by default for sqlite-utils.

Originally posted by @simonw in #149 (comment)

@simonw simonw added the enhancement New feature or request label Sep 7, 2020
@simonw
Copy link
Owner Author

simonw commented Sep 7, 2020

I'm going to make this an argument to the Database() class constructor which defaults to True.

@simonw
Copy link
Owner Author

simonw commented Sep 7, 2020

The principle reason to turn these on - at least so far - is that without it weird things happen where FTS tables (in particular *_fts_docsize) grow without limit over time, because calls to INSERT OR REPLACE against the parent table cause additional rows to be inserted into *_fts_docsize even if the row was replaced rather than being inserted.

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

No branches or pull requests

1 participant