-
Notifications
You must be signed in to change notification settings - Fork 198
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
:on-delete :cascade #698
base: main
Are you sure you want to change the base?
:on-delete :cascade #698
Conversation
tonsky
commented
Jan 9, 2025
•
edited
Loading
edited
- Optimize current on-delete impl
- Transform it into single recursive query
- Add delete-entity support to client datalog
- Add option to the explorer
- Add option to CLI schema file
3a084cd
to
193d5af
Compare
View Vercel preview at instant-www-js-optimize-cascade-delete-jsv.vercel.app. |
Progress so far:
|
b9f9191
to
0d35b0c
Compare
0d35b0c
to
293ab5b
Compare
(assoc acc :deep-merge-triple (triple-model/deep-merge-multi! conn attrs app-id args)) | ||
|
||
:retract-triple | ||
(assoc acc :retract-triple (triple-model/delete-multi! conn app-id args)))) | ||
{} | ||
(batch tx-steps)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this might be simpler if batch
did a group-by instead of whatever it's currently doing.
:update-attr | ||
(assoc acc :update-attr (attr-model/update-multi! conn app-id args)) | ||
|
||
:delete-entity-no-cascade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have :delete-entity-no-cascade
as an operation? Do we expect users to use it or is it just for our internal usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is that we don’t try to expand :delete-entity
second time, since some methods call transact-without-tx-conn!
directly and some permissioned-transaction/transact!
db7d1ee
to
e2b34a9
Compare
To the best of my abilities, I made cascade expansion as a single query but it still sometimes triggers slow path. One of the culprits, I think, is I left a TODO, maybe plan it as a separate task? |
e2b34a9
to
3a7869c
Compare