-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Function to handle after_update metadata tracking #363
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tantaman
force-pushed
the
trigger-fns
branch
from
September 20, 2023 17:27
8a06021
to
a252ae6
Compare
tantaman
force-pushed
the
trigger-fns
branch
from
September 20, 2023 18:07
a252ae6
to
b9b4671
Compare
tantaman
force-pushed
the
fix-errmsg-set
branch
2 times, most recently
from
September 20, 2023 18:17
37504dd
to
1e9d3ff
Compare
tantaman
force-pushed
the
trigger-fns
branch
from
September 20, 2023 18:33
b9b4671
to
1fd732e
Compare
tantaman
force-pushed
the
trigger-fns
branch
from
September 20, 2023 20:22
1fd732e
to
02e7384
Compare
tantaman
force-pushed
the
trigger-fns
branch
5 times, most recently
from
September 26, 2023 15:01
cf32162
to
58bce82
Compare
…this in a separate branch
tantaman
force-pushed
the
trigger-fns
branch
from
September 26, 2023 16:55
af9f41f
to
1ed37e3
Compare
tantaman
force-pushed
the
trigger-fns
branch
from
September 26, 2023 17:22
1ed37e3
to
cf6c194
Compare
…replace it e.g., update or replace
tantaman
force-pushed
the
trigger-fns
branch
from
September 26, 2023 19:52
423392c
to
05aaeae
Compare
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Creating a lookaside table for primary keys ends up making triggers rather complex since they must either update or consult this lookaside in multiple places and we are not able to store variables in triggers.
In other words, we have a bunch of
The
update
trigger also installs more than one trigger for update in order to handle primary key changes since changing a primary key is an update + delete.Triggers do not run in a deterministic order in SQLite so each trigger would need to write the lookaside.
To try to simplify all this, I'm moving everything into a function so triggers will become:
and
crsql_after_update
will do all the correct thing.