Use sqlite-web transaction local DB API#2795
Conversation
How to use the Graphite Merge QueueAdd the label Raindex-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (29)
📝 WalkthroughWalkthroughThe PR reworks SQL execution into transaction batches (new ChangesSQL batch execution refactor
Estimated code review effort: 4 (Complex) | ~60 minutes Local DB options-object API refactor
Estimated code review effort: 5 (Critical) | ~110 minutes Sequence Diagram(s)sequenceDiagram
participant JS
participant RaindexClient
participant LocalDbClientOptions
participant LocalDb
participant JsCallbackExecutor
participant JsLocalDb
JS->>RaindexClient: new(settings, subgraphs, options)
RaindexClient->>LocalDbClientOptions: parse(options)
LocalDbClientOptions-->>RaindexClient: localDb, statusCallback
RaindexClient->>LocalDb: from_js_local_db(localDb)
LocalDb->>JsCallbackExecutor: new(local_db)
JsCallbackExecutor->>JsLocalDb: query / wipeAndRecreate / transaction (validated)
sequenceDiagram
participant BootstrapPipeline
participant Executor
participant JsCallbackExecutor
participant JsLocalDb
BootstrapPipeline->>Executor: execute_batch(clear_tables_batch())
BootstrapPipeline->>Executor: query_text(vacuum_stmt())
BootstrapPipeline->>Executor: execute_batch(create_tables_batch())
Executor->>JsCallbackExecutor: invoke_transaction_unlocked(batch)
JsCallbackExecutor->>JsLocalDb: transaction(local_db, statements array)
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
93b918a to
237ca76
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (6)
crates/common/src/local_db/query/create_tables/statements/063.sql (1)
1-2: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winSame missing
IF NOT EXISTSconcern as flagged in059.sql.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/common/src/local_db/query/create_tables/statements/063.sql` around lines 1 - 2, The CREATE INDEX statement in the derived_trades migration is missing the same IF NOT EXISTS guard as the related index migration; update the index definition for idx_derived_trades_tx to use a safe idempotent creation pattern. Keep the change in the SQL migration that defines derived_trades indexes so reruns do not fail when the index already exists.crates/common/src/local_db/query/create_tables/statements/062.sql (1)
1-2: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winSame missing
IF NOT EXISTSconcern as flagged in059.sql.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/common/src/local_db/query/create_tables/statements/062.sql` around lines 1 - 2, Add IF NOT EXISTS to the CREATE INDEX statement in the derived trades index migration, matching the pattern used in 059.sql. Update the index definition for idx_derived_trades_order_hash_time so the statement is idempotent and can be re-run safely without failing if the index already exists.crates/common/src/local_db/query/create_tables/statements/060.sql (1)
1-2: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winSame missing
IF NOT EXISTSconcern as flagged in059.sql.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/common/src/local_db/query/create_tables/statements/060.sql` around lines 1 - 2, The CREATE INDEX statement for the derived_trades table is missing the same guard as 059.sql, so update the index definition to use IF NOT EXISTS. Modify the CREATE INDEX for idx_derived_trades_owner_time in the SQL statement so repeated schema application won’t fail when the index already exists.crates/common/src/local_db/query/create_tables/statements/058.sql (1)
1-2: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winSame missing
IF NOT EXISTSconcern as flagged in059.sql.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/common/src/local_db/query/create_tables/statements/058.sql` around lines 1 - 2, The CREATE INDEX statement in the derived trades migration is missing the same IF NOT EXISTS guard as the related index definition in 059.sql. Update the statement for idx_derived_trades_input_token_time to include IF NOT EXISTS so repeated runs of the migration remain idempotent, and keep the change localized to the CREATE INDEX statement in the 058.sql script.crates/common/src/local_db/query/create_tables/statements/064.sql (1)
1-2: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winSame missing
IF NOT EXISTSconcern as flagged in059.sql.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/common/src/local_db/query/create_tables/statements/064.sql` around lines 1 - 2, The CREATE INDEX statement for idx_derived_trades_time is missing the same IF NOT EXISTS guard used elsewhere. Update the index definition in the 064.sql migration to include IF NOT EXISTS so repeated runs do not fail, matching the pattern already used in the related 059.sql statement.crates/common/src/local_db/query/create_tables/statements/061.sql (1)
1-2: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winSame missing
IF NOT EXISTSconcern as flagged in059.sql.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/common/src/local_db/query/create_tables/statements/061.sql` around lines 1 - 2, Add IF NOT EXISTS to the CREATE INDEX statement in the derived_trades migration, matching the pattern used in 059.sql. Update the idx_derived_trades_taker_time statement so repeated runs are idempotent and do not fail if the index already exists.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/common/src/local_db/query/create_tables/mod.rs`:
- Around line 1-70: Keep CREATE_TABLES_SQL and CREATE_TABLES_STATEMENTS
synchronized in create_tables/mod.rs by adding a test similar to create_views
that verifies the split statement array matches query.sql and stays aligned. Use
the existing CREATE_TABLES_SQL constant, CREATE_TABLES_STATEMENTS slice, and
SqlStatementBatch/SqlStatement setup to assert the batch content matches the
source SQL so future edits can’t drift silently.
In `@crates/common/src/raindex_client/local_db/executor.rs`:
- Around line 101-108: The manual loops in invoke_transaction_unlocked and the
other affected JS array-building path should be rewritten with iterator adapters
instead of explicit for loops. Keep the fallible transaction_statement
conversion chained with ? inside a try_for_each/for_each or equivalent iterator
pipeline, and preserve the existing behavior of pushing each converted item into
the Array builder. Use the existing symbols invoke_transaction_unlocked and
transaction_statement as the main touchpoints, and apply the same refactor to
the second loop range noted in the review.
In `@crates/common/src/raindex_client/local_db/query/create_tables.rs`:
- Around line 23-62: The test wrapper_uses_transaction_batch is too loose
because it only checks that transaction receives more than one statement. Update
the assertion to verify the exact expected batch size for create_tables, using
the statement list from CREATE_TABLES_STATEMENTS or the create_tables path in
create_tables.rs, so regressions that drop statements are caught. Keep the
existing transaction capture in wrapper_uses_transaction_batch and assert the
received array length matches the full expected count.
---
Duplicate comments:
In `@crates/common/src/local_db/query/create_tables/statements/058.sql`:
- Around line 1-2: The CREATE INDEX statement in the derived trades migration is
missing the same IF NOT EXISTS guard as the related index definition in 059.sql.
Update the statement for idx_derived_trades_input_token_time to include IF NOT
EXISTS so repeated runs of the migration remain idempotent, and keep the change
localized to the CREATE INDEX statement in the 058.sql script.
In `@crates/common/src/local_db/query/create_tables/statements/060.sql`:
- Around line 1-2: The CREATE INDEX statement for the derived_trades table is
missing the same guard as 059.sql, so update the index definition to use IF NOT
EXISTS. Modify the CREATE INDEX for idx_derived_trades_owner_time in the SQL
statement so repeated schema application won’t fail when the index already
exists.
In `@crates/common/src/local_db/query/create_tables/statements/061.sql`:
- Around line 1-2: Add IF NOT EXISTS to the CREATE INDEX statement in the
derived_trades migration, matching the pattern used in 059.sql. Update the
idx_derived_trades_taker_time statement so repeated runs are idempotent and do
not fail if the index already exists.
In `@crates/common/src/local_db/query/create_tables/statements/062.sql`:
- Around line 1-2: Add IF NOT EXISTS to the CREATE INDEX statement in the
derived trades index migration, matching the pattern used in 059.sql. Update the
index definition for idx_derived_trades_order_hash_time so the statement is
idempotent and can be re-run safely without failing if the index already exists.
In `@crates/common/src/local_db/query/create_tables/statements/063.sql`:
- Around line 1-2: The CREATE INDEX statement in the derived_trades migration is
missing the same IF NOT EXISTS guard as the related index migration; update the
index definition for idx_derived_trades_tx to use a safe idempotent creation
pattern. Keep the change in the SQL migration that defines derived_trades
indexes so reruns do not fail when the index already exists.
In `@crates/common/src/local_db/query/create_tables/statements/064.sql`:
- Around line 1-2: The CREATE INDEX statement for idx_derived_trades_time is
missing the same IF NOT EXISTS guard used elsewhere. Update the index definition
in the 064.sql migration to include IF NOT EXISTS so repeated runs do not fail,
matching the pattern already used in the related 059.sql statement.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e2585064-a67e-4c6f-b7ef-de8901c52565
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (118)
crates/cli/src/commands/local_db/pipeline/bootstrap.rscrates/common/src/local_db/executor.rscrates/common/src/local_db/pipeline/adapters/bootstrap.rscrates/common/src/local_db/query/clear_tables/mod.rscrates/common/src/local_db/query/clear_tables/statements/001.sqlcrates/common/src/local_db/query/clear_tables/statements/002.sqlcrates/common/src/local_db/query/clear_tables/statements/003.sqlcrates/common/src/local_db/query/clear_tables/statements/004.sqlcrates/common/src/local_db/query/clear_tables/statements/005.sqlcrates/common/src/local_db/query/clear_tables/statements/006.sqlcrates/common/src/local_db/query/clear_tables/statements/007.sqlcrates/common/src/local_db/query/clear_tables/statements/008.sqlcrates/common/src/local_db/query/clear_tables/statements/009.sqlcrates/common/src/local_db/query/clear_tables/statements/010.sqlcrates/common/src/local_db/query/clear_tables/statements/011.sqlcrates/common/src/local_db/query/clear_tables/statements/012.sqlcrates/common/src/local_db/query/clear_tables/statements/013.sqlcrates/common/src/local_db/query/clear_tables/statements/014.sqlcrates/common/src/local_db/query/clear_tables/statements/015.sqlcrates/common/src/local_db/query/clear_tables/statements/016.sqlcrates/common/src/local_db/query/clear_tables/statements/017.sqlcrates/common/src/local_db/query/clear_tables/statements/018.sqlcrates/common/src/local_db/query/clear_tables/statements/019.sqlcrates/common/src/local_db/query/clear_tables/statements/020.sqlcrates/common/src/local_db/query/clear_tables/statements/021.sqlcrates/common/src/local_db/query/clear_tables/statements/022.sqlcrates/common/src/local_db/query/clear_tables/statements/023.sqlcrates/common/src/local_db/query/clear_tables/statements/024.sqlcrates/common/src/local_db/query/create_tables/mod.rscrates/common/src/local_db/query/create_tables/statements/001.sqlcrates/common/src/local_db/query/create_tables/statements/002.sqlcrates/common/src/local_db/query/create_tables/statements/003.sqlcrates/common/src/local_db/query/create_tables/statements/004.sqlcrates/common/src/local_db/query/create_tables/statements/005.sqlcrates/common/src/local_db/query/create_tables/statements/006.sqlcrates/common/src/local_db/query/create_tables/statements/007.sqlcrates/common/src/local_db/query/create_tables/statements/008.sqlcrates/common/src/local_db/query/create_tables/statements/009.sqlcrates/common/src/local_db/query/create_tables/statements/010.sqlcrates/common/src/local_db/query/create_tables/statements/011.sqlcrates/common/src/local_db/query/create_tables/statements/012.sqlcrates/common/src/local_db/query/create_tables/statements/013.sqlcrates/common/src/local_db/query/create_tables/statements/014.sqlcrates/common/src/local_db/query/create_tables/statements/015.sqlcrates/common/src/local_db/query/create_tables/statements/016.sqlcrates/common/src/local_db/query/create_tables/statements/017.sqlcrates/common/src/local_db/query/create_tables/statements/018.sqlcrates/common/src/local_db/query/create_tables/statements/019.sqlcrates/common/src/local_db/query/create_tables/statements/020.sqlcrates/common/src/local_db/query/create_tables/statements/021.sqlcrates/common/src/local_db/query/create_tables/statements/022.sqlcrates/common/src/local_db/query/create_tables/statements/023.sqlcrates/common/src/local_db/query/create_tables/statements/024.sqlcrates/common/src/local_db/query/create_tables/statements/025.sqlcrates/common/src/local_db/query/create_tables/statements/026.sqlcrates/common/src/local_db/query/create_tables/statements/027.sqlcrates/common/src/local_db/query/create_tables/statements/028.sqlcrates/common/src/local_db/query/create_tables/statements/029.sqlcrates/common/src/local_db/query/create_tables/statements/030.sqlcrates/common/src/local_db/query/create_tables/statements/031.sqlcrates/common/src/local_db/query/create_tables/statements/032.sqlcrates/common/src/local_db/query/create_tables/statements/033.sqlcrates/common/src/local_db/query/create_tables/statements/034.sqlcrates/common/src/local_db/query/create_tables/statements/035.sqlcrates/common/src/local_db/query/create_tables/statements/036.sqlcrates/common/src/local_db/query/create_tables/statements/037.sqlcrates/common/src/local_db/query/create_tables/statements/038.sqlcrates/common/src/local_db/query/create_tables/statements/039.sqlcrates/common/src/local_db/query/create_tables/statements/040.sqlcrates/common/src/local_db/query/create_tables/statements/041.sqlcrates/common/src/local_db/query/create_tables/statements/042.sqlcrates/common/src/local_db/query/create_tables/statements/043.sqlcrates/common/src/local_db/query/create_tables/statements/044.sqlcrates/common/src/local_db/query/create_tables/statements/045.sqlcrates/common/src/local_db/query/create_tables/statements/046.sqlcrates/common/src/local_db/query/create_tables/statements/047.sqlcrates/common/src/local_db/query/create_tables/statements/048.sqlcrates/common/src/local_db/query/create_tables/statements/049.sqlcrates/common/src/local_db/query/create_tables/statements/050.sqlcrates/common/src/local_db/query/create_tables/statements/051.sqlcrates/common/src/local_db/query/create_tables/statements/052.sqlcrates/common/src/local_db/query/create_tables/statements/053.sqlcrates/common/src/local_db/query/create_tables/statements/054.sqlcrates/common/src/local_db/query/create_tables/statements/055.sqlcrates/common/src/local_db/query/create_tables/statements/056.sqlcrates/common/src/local_db/query/create_tables/statements/057.sqlcrates/common/src/local_db/query/create_tables/statements/058.sqlcrates/common/src/local_db/query/create_tables/statements/059.sqlcrates/common/src/local_db/query/create_tables/statements/060.sqlcrates/common/src/local_db/query/create_tables/statements/061.sqlcrates/common/src/local_db/query/create_tables/statements/062.sqlcrates/common/src/local_db/query/create_tables/statements/063.sqlcrates/common/src/local_db/query/create_tables/statements/064.sqlcrates/common/src/local_db/query/create_tables/statements/065.sqlcrates/common/src/local_db/query/create_views/mod.rscrates/common/src/local_db/query/create_views/vault_deltas/001.sqlcrates/common/src/local_db/query/create_views/vault_deltas/002.sqlcrates/common/src/local_db/query/sql_statement_batch.rscrates/common/src/raindex_client/local_db/executor.rscrates/common/src/raindex_client/local_db/mod.rscrates/common/src/raindex_client/local_db/orders.rscrates/common/src/raindex_client/local_db/pipeline/bootstrap.rscrates/common/src/raindex_client/local_db/pipeline/runner/scheduler/wasm.rscrates/common/src/raindex_client/local_db/query/clear_tables.rscrates/common/src/raindex_client/local_db/query/create_tables.rscrates/common/src/raindex_client/local_db/vaults.rscrates/common/src/raindex_client/mod.rscrates/common/src/raindex_client/raindex_yaml.rscrates/common/src/raindex_client/trades/get_by_owner.rscrates/common/src/raindex_client/trades/get_by_tx.rscrates/common/src/raindex_client/trades/mod.rscrates/common/src/raindex_client/vaults.rscrates/js_api/src/registry.rspackage.jsonpackages/raindex/ARCHITECTURE.mdpackages/raindex/README.mdpackages/webapp/ARCHITECTURE.mdpackages/webapp/src/routes/+layout.ts
3142682 to
b080e7d
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/common/src/local_db/query/create_views/mod.rs (1)
19-24: 🩺 Stability & Availability | 🔵 Trivial | 🏗️ Heavy liftAvoid a production panic in
view_statement().If
vault_deltas.sqlever stops splitting into exactly two statements, both public helpers panic here. Prefer validating once and propagating a typed error instead of relying onexpect()in a runtime path. As per coding guidelines, "reserveunwrap()/expect()for tests and invariants that can be proven infallible".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/common/src/local_db/query/create_views/mod.rs` around lines 19 - 24, The helper in view_statement() currently uses expect() on SqlScript::new(VAULT_DELTAS_VIEW_SQL).statements(), which can panic in production if the SQL no longer splits as assumed. Replace this with a validated path that checks the statement count once, returns a typed error on mismatch, and have the public helpers that depend on view_statement() propagate that error instead of panicking.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/common/src/local_db/query/sql_script.rs`:
- Around line 87-102: The tail handling in split_statements is pushing
comment-only fragments because it only checks trim() emptiness, so inputs like
"SELECT 1; -- note" become a spurious second batch item. Update split_statements
to track whether the current slice contains executable SQL outside comments
before pushing the final statement, and use that same logic for any
batch-finalizing path in this function. Add a regression test covering a
trailing comment-only fragment to ensure it is skipped.
---
Nitpick comments:
In `@crates/common/src/local_db/query/create_views/mod.rs`:
- Around line 19-24: The helper in view_statement() currently uses expect() on
SqlScript::new(VAULT_DELTAS_VIEW_SQL).statements(), which can panic in
production if the SQL no longer splits as assumed. Replace this with a validated
path that checks the statement count once, returns a typed error on mismatch,
and have the public helpers that depend on view_statement() propagate that error
instead of panicking.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ee77a9c4-482c-44e5-9bd9-a337327eb38f
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (29)
crates/cli/src/commands/local_db/pipeline/bootstrap.rscrates/common/src/local_db/executor.rscrates/common/src/local_db/pipeline/adapters/bootstrap.rscrates/common/src/local_db/query/clear_tables/mod.rscrates/common/src/local_db/query/create_tables/mod.rscrates/common/src/local_db/query/create_views/mod.rscrates/common/src/local_db/query/mod.rscrates/common/src/local_db/query/sql_script.rscrates/common/src/local_db/query/sql_statement_batch.rscrates/common/src/raindex_client/local_db/executor.rscrates/common/src/raindex_client/local_db/mod.rscrates/common/src/raindex_client/local_db/orders.rscrates/common/src/raindex_client/local_db/pipeline/bootstrap.rscrates/common/src/raindex_client/local_db/pipeline/runner/scheduler/wasm.rscrates/common/src/raindex_client/local_db/query/clear_tables.rscrates/common/src/raindex_client/local_db/query/create_tables.rscrates/common/src/raindex_client/local_db/vaults.rscrates/common/src/raindex_client/mod.rscrates/common/src/raindex_client/raindex_yaml.rscrates/common/src/raindex_client/trades/get_by_owner.rscrates/common/src/raindex_client/trades/get_by_tx.rscrates/common/src/raindex_client/trades/mod.rscrates/common/src/raindex_client/vaults.rscrates/js_api/src/registry.rspackage.jsonpackages/raindex/ARCHITECTURE.mdpackages/raindex/README.mdpackages/webapp/ARCHITECTURE.mdpackages/webapp/src/routes/+layout.ts
✅ Files skipped from review due to trivial changes (3)
- packages/webapp/ARCHITECTURE.md
- packages/raindex/ARCHITECTURE.md
- packages/raindex/README.md
🚧 Files skipped from review as they are similar to previous changes (21)
- crates/common/src/raindex_client/trades/get_by_owner.rs
- crates/common/src/raindex_client/local_db/pipeline/runner/scheduler/wasm.rs
- crates/common/src/raindex_client/raindex_yaml.rs
- crates/common/src/local_db/query/clear_tables/mod.rs
- crates/common/src/raindex_client/trades/get_by_tx.rs
- package.json
- crates/common/src/raindex_client/local_db/query/clear_tables.rs
- packages/webapp/src/routes/+layout.ts
- crates/js_api/src/registry.rs
- crates/common/src/raindex_client/trades/mod.rs
- crates/common/src/local_db/executor.rs
- crates/common/src/raindex_client/local_db/query/create_tables.rs
- crates/common/src/raindex_client/local_db/orders.rs
- crates/common/src/raindex_client/vaults.rs
- crates/common/src/raindex_client/local_db/mod.rs
- crates/common/src/raindex_client/local_db/pipeline/bootstrap.rs
- crates/cli/src/commands/local_db/pipeline/bootstrap.rs
- crates/common/src/raindex_client/local_db/vaults.rs
- crates/common/src/local_db/pipeline/adapters/bootstrap.rs
- crates/common/src/raindex_client/mod.rs
- crates/common/src/local_db/query/sql_statement_batch.rs
b080e7d to
1afc572
Compare

Summary
@rainlanguage/sqlite-webto0.0.3{ localDb, statusCallback }localDb.query,localDb.wipeAndRecreate, andlocalDb.transactionfor sync YAMLslocalDb.transaction([...])call instead of looping queries with manualBEGIN/COMMIT.sqlscripts and adapt them into sqlite-web-compatible single-statement batches at the Rust boundaryReview
{ localDb, statusCallback }options path and missingtransactionvalidation.Verification
cargo check -p raindex_commoncargo check -p raindex_common -p raindex_clicargo test --workspacecargo test -p raindex_common local_db::cargo test -p raindex_cli local_db::pipeline::bootstrapnix develop .#wasm-shell -c bash -c 'CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner cargo test --target wasm32-unknown-unknown --lib -p raindex_quote -p raindex_bindings -p raindex_js_api -p raindex_common'nix develop .#wasm-shell -c bash -c 'npm install --no-check && cd packages/raindex && npm run build && npm test'nix develop .#wasm-shell -c bash -c 'npm install --no-check && npm run svelte-lint-format-check -w @rainlanguage/webapp && npm run test -w @rainlanguage/webapp'nix develop .#wasm-shell -c bash -c 'npm install --no-check && npm run build -w @rainlanguage/raindex && npm run build -w @rainlanguage/ui-components && npm run build -w @rainlanguage/webapp && npm run lint-format-check:all && npm run test --workspaces'git diff --checknix develop -c rainix-rs-statichttp://127.0.0.1:5173/db-playgroundBatch statements must contain a single statementLOCALDB ACTIVE; schema query returned local DB tables;db_metadatareturned{ id: 1, db_schema_version: 5 }Summary by CodeRabbit
New Features
Bug Fixes
Documentation