Skip to content

DRAFT: simple subqueries with DNF#4051

Draft
robacourt wants to merge 71 commits intomainfrom
rob/simple-subqueries-with-dnf
Draft

DRAFT: simple subqueries with DNF#4051
robacourt wants to merge 71 commits intomainfrom
rob/simple-subqueries-with-dnf

Conversation

@robacourt
Copy link
Copy Markdown
Contributor

No description provided.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 84.44444% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.71%. Comparing base (cb2c45e) to head (48f9d65).
⚠️ Report is 15 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...kages/elixir-client/lib/electric/client/message.ex 0.00% 7 Missing ⚠️
...s/elixir-client/lib/electric/client/tag_tracker.ex 94.44% 4 Missing ⚠️
packages/elixir-client/lib/electric/client/poll.ex 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4051      +/-   ##
==========================================
- Coverage   85.90%   85.71%   -0.20%     
==========================================
  Files          51       51              
  Lines        3399     3465      +66     
  Branches      610      612       +2     
==========================================
+ Hits         2920     2970      +50     
- Misses        477      493      +16     
  Partials        2        2              
Flag Coverage Δ
elixir 78.67% <84.44%> (-0.21%) ⬇️
elixir-client 78.67% <84.44%> (-0.21%) ⬇️
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/start 82.83% <ø> (ø)
packages/typescript-client 93.81% <ø> (ø)
packages/y-electric 56.05% <ø> (ø)
typescript 88.67% <ø> (ø)
unit-tests 85.71% <84.44%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

🏋️ Load test triggered for 38e4688. Results will be posted here when complete.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, triggered for 38e46

  • controlled load test failed

controlled load test results

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 25, 2026

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit 48f9d65
🔍 Latest deploy log https://app.netlify.com/projects/electric-next/deploys/69d4d0008302820008ee0afa
😎 Deploy Preview https://deploy-preview-4051--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@robacourt robacourt force-pushed the rob/simple-subqueries-with-dnf branch 2 times, most recently from c7da8bb to f33c781 Compare March 25, 2026 14:38
@github-actions
Copy link
Copy Markdown
Contributor

🏋️ Load test triggered for f33c781. Results will be posted here when complete.

@github-actions
Copy link
Copy Markdown
Contributor

🏋️ Load test triggered for 6715aea. Results will be posted here when complete.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, triggered for f33c7

  • controlled load test completed

controlled load test results

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, triggered for 6715a

  • controlled load test completed

controlled load test results

@robacourt robacourt force-pushed the rob/simple-subqueries-with-dnf branch 2 times, most recently from 6669eb8 to a1e0fc1 Compare March 26, 2026 12:38
@robacourt robacourt force-pushed the rob/simple-subqueries-with-dnf branch from 226f9b3 to 203f4fc Compare March 26, 2026 16:51
robacourt and others added 11 commits March 30, 2026 17:18
…link-values cache and inverted index (#3937)"

This reverts commit 8fe0a37.
Add active_conditions support to the sync protocol as a
backward-compatible change, preparing for OR/NOT in WHERE clauses.

Elixir client (from #3791):
- Tags become {position, hash} tuples with slash-delimited wire format
- active_conditions tracking and DNF visibility evaluation
- disjunct_positions derived once per shape, shared across keys

Server (minimal changes for simple case):
- Add active_conditions field to NewRecord/UpdatedRecord/DeletedRecord
- Include active_conditions in JSON headers when present
- Compute active_conditions: [true, ...] for shapes with subqueries
- Include active_conditions in snapshot SQL queries
- Read Electric-Protocol-Version header from HTTP requests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
robacourt and others added 29 commits March 30, 2026 17:23
Make SubqueryIndex ETS table :public and discoverable via persistent_term
so consumers can write membership entries. Consumer seeds initial views
into the index during initialize_subquery_runtime and marks shapes ready.
Dynamic updates are applied by diffing routing views before/after each
subquery state transition, with conservative projections during buffering
(union for positive, intersection for negated dependencies).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the unconditional subquery_shape_ids_for_table union in
shapes_affected_by_record with reverse-index candidate lookup plus
exact WHERE clause verification. Candidate shapes are verified
against the full predicate using the SubqueryIndex-backed
subquery_member? callback. Fallback shapes (not yet seeded by their
consumer) pass through without verification for safety.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Stage 6)

Remove refs_fun from Filter struct and WhereCondition - subquery
evaluation now uses SubqueryIndex-backed callbacks exclusively.
Replace the unconditional subquery_shape_ids_for_table union with
reverse-index candidate lookup in shapes_affected_by_record.
Re-enable the previously skipped OR+subquery test which now works
correctly with seeded index membership. Update existing tests to
clarify they test fallback (unseeded) behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ng move-in

The subquery buffering state machine can accumulate transactions
indefinitely while waiting for a move-in query to complete. Add a
configurable limit (default 1000) that emits a :shutdown action when
exceeded, terminating the shape and triggering a 409 must-refetch for
clients.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@robacourt robacourt force-pushed the rob/simple-subqueries-with-dnf branch from 5999217 to 48f9d65 Compare April 7, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants