Repository navigation
api: expose the shared engine facade - #25
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (2)**/*📄 CodeRabbit inference engine (AGENTS.md)
Files:
crates/**/*.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
🔇 Additional comments (2)
WalkthroughChangesThe SQLite engine facade and related request types are made public, bounded event paging and version reads are exposed, snapshot attachment now validates persisted events, and backend schema migration delegates through Engine facade and commit flow
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
728a17c to
58ff308
Compare
13bb559 to
5d46691
Compare
58ff308 to
d4b3ef1
Compare
5d46691 to
7e3232b
Compare
d4b3ef1 to
77c3ba8
Compare
7e3232b to
277ac60
Compare
77c3ba8 to
089e5c2
Compare
277ac60 to
350262e
Compare
089e5c2 to
8bb49f6
Compare
350262e to
3e8cffd
Compare
8bb49f6 to
d090e49
Compare
b3875b8 to
7aa769e
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/event-sorcery/src/job_sqlite.rs`:
- Line 78: Add a backend-level test for SqliteBackend::migrate that uses an
in-memory SQLite database and invokes migration through the EventBackend
interface, rather than calling Engine::migrate directly. Preserve the existing
migration assertions while covering the SqliteBackend implementation path.
🪄 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: ASSERTIVE
Plan: Pro Plus
Run ID: 9e9d506b-ef4e-4159-8ff3-9551d14df7ed
📒 Files selected for processing (4)
crates/event-sorcery/src/engine.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/lib.rscrates/event-sorcery/src/sqlite_event_repository.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*
📄 CodeRabbit inference engine (AGENTS.md)
**/*: Before work, read SPEC.md and docs/domain.md; read relevant supplemental documentation before implementation.
New features must be documented in SPEC.md before implementation and must follow the hierarchy SPEC.md -> issue -> plan -> tests -> implementation.
Fix all known problems immediately, complete all tasks, and do not allow warnings or errors to pass through.
Keep a granular task list and clear completed tasks from the active list.
All new or modified logic must have corresponding test coverage.
Understand relevant documentation and source code before implementation, keep diffs small, and review the approach critically.
When changing direction or making an important undocumented architectural decision, obtain confirmation; record significant decisions as ADRs under adrs/.
Before handover, review the diff, revert unjustified changes, and check for scope creep.
Each aggregate in a consuming application must use exactly one SqliteCqrs instance constructed at startup; per-request construction is forbidden.
Never read secret or credential files such as .env*, credentials.json, *.key, *.pem, *.p12, *.pfx, or sensitive database files without explicit permission.
Never bypass, disable, suppress, or obscure quality-control mechanisms without explicit permission; fix lint and test issues at their root.
Use cargo check, cargo nextest, and cargo clippy for verification; never use cargo build unless build artifacts are required.
Files:
crates/event-sorcery/src/lib.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/sqlite_event_repository.rscrates/event-sorcery/src/engine.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Organize code by business feature rather than technical layer; avoid catch-all modules such as types.rs, error.rs, models.rs, utils.rs, helpers.rs, and services.rs.
Never write directly to the events table; emit events through CqrsFramework::execute() or execute_with_metadata().
Use cqrs-es Services for side effects in handle() and follow the {Action}er -> {Domain}Service -> {Domain}Manager naming pattern.
Place command-execution logging in aggregate handle() methods rather than callers.
Model invalid states with enums, ADTs, newtypes, and typestate rather than relying on runtime validation.
Use domain newtypes at APIs and convert to SDK primitives inside the callee, except at cross-crate boundaries where conversion at the call site is necessary.
Keep visibility as restrictive as possible: private over pub(crate) over pub.
Use a three-group import order: external crates, workspace crates, then crate-internal imports; do not use function-level imports except enum variants.
Do not use unwrap() or expect() in production Rust code; they are permitted in #[cfg(test)] code.
Never create error variants containing opaque String values; prefer #[from], ?, #[source], and preserve error chains.
Log a warning or error before silent early returns such as let-else failures.
Never silently mask numeric failures with caps, fallback defaults, precision truncation, unwrap_or(), or unwrap_or_default(); use explicit checked conversions and errors.
Prefer functional patterns, pattern matching, combinators, type-driven design, and iterators over imperative loops unless complexity increases.
Use ASCII in identifiers, comments, log messages, and configuration keys; Unicode is preferred only in user-facing rendered output.
Do not use single-letter variables, arguments, closure parameters, or generic type parameters except an unambiguous lone type parameter or short unambiguous closure.
Every module must have a //! docstring and should order public API, private implementati...
Files:
crates/event-sorcery/src/lib.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/sqlite_event_repository.rscrates/event-sorcery/src/engine.rs
🔇 Additional comments (4)
crates/event-sorcery/src/engine.rs (2)
17-63: LGTM!Also applies to: 67-74, 94-117, 385-460, 800-808, 820-821
705-710: 🎯 Functional CorrectnessLeave the raw pool here.
create_test_pool()applies migrations up front, so it would skip the path this test is meant to cover, and the repository’s SQLite fixture also uses:memory:.> Likely an incorrect or invalid review comment.crates/event-sorcery/src/sqlite_event_repository.rs (1)
125-125: LGTM!crates/event-sorcery/src/lib.rs (1)
128-128: 🗄️ Data Integrity & IntegrationNo additional re-exports needed here. The crate root already exposes
SqliteJobError,ClaimDecision,ClaimOutcome,ClaimRead, andLeaseRenewal, so the publicEnginesurface is reachable as-is.> Likely an incorrect or invalid review comment.
|
@coderabbitai review |
✅ Action performedReview finished.
|
7aa769e to
03c01e6
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/event-sorcery/src/engine.rs`:
- Around line 707-708: Configure the test SQLite pools in
crates/event-sorcery/src/engine.rs lines 707-708 and
crates/event-sorcery/src/job_sqlite.rs lines 119-120 with
SqlitePoolOptions::new().max_connections(1) before connecting to :memory:,
preserving the existing Engine::new and job test setup.
In `@crates/event-sorcery/src/job_sqlite.rs`:
- Around line 109-110: Add a module-level `//!` documentation comment
immediately inside the `tests` module declaration, describing the purpose of the
test module.
In `@crates/event-sorcery/src/sqlite_event_repository.rs`:
- Line 125: Add a regression test for the `SqliteEventRepository::persist` path
using an empty event list with a snapshot, asserting that it returns the
propagated `PersistenceError` from `CommitRequest::with_snapshot` and that the
database remains unchanged. Reuse the repository’s existing test setup and
persistence helpers, and avoid changing production behavior.
🪄 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: ASSERTIVE
Plan: Pro Plus
Run ID: 9d3d4b86-06fc-49e9-a41f-e6b67fce79aa
📒 Files selected for processing (4)
crates/event-sorcery/src/engine.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/lib.rscrates/event-sorcery/src/sqlite_event_repository.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
- GitHub Check: examples
- GitHub Check: clippy
- GitHub Check: check
- GitHub Check: test
- GitHub Check: fmt
- GitHub Check: hooks
🧰 Additional context used
📓 Path-based instructions (2)
**/*
📄 CodeRabbit inference engine (AGENTS.md)
**/*: Before work, read SPEC.md and docs/domain.md; read relevant supplemental documentation before implementation.
New features must be documented in SPEC.md before implementation and must follow the hierarchy SPEC.md -> issue -> plan -> tests -> implementation.
Fix all known problems immediately, complete all tasks, and do not allow warnings or errors to pass through.
Keep a granular task list and clear completed tasks from the active list.
All new or modified logic must have corresponding test coverage.
Understand relevant documentation and source code before implementation, keep diffs small, and review the approach critically.
When changing direction or making an important undocumented architectural decision, obtain confirmation; record significant decisions as ADRs under adrs/.
Before handover, review the diff, revert unjustified changes, and check for scope creep.
Each aggregate in a consuming application must use exactly one SqliteCqrs instance constructed at startup; per-request construction is forbidden.
Never read secret or credential files such as .env*, credentials.json, *.key, *.pem, *.p12, *.pfx, or sensitive database files without explicit permission.
Never bypass, disable, suppress, or obscure quality-control mechanisms without explicit permission; fix lint and test issues at their root.
Use cargo check, cargo nextest, and cargo clippy for verification; never use cargo build unless build artifacts are required.
Files:
crates/event-sorcery/src/sqlite_event_repository.rscrates/event-sorcery/src/lib.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/engine.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Organize code by business feature rather than technical layer; avoid catch-all modules such as types.rs, error.rs, models.rs, utils.rs, helpers.rs, and services.rs.
Never write directly to the events table; emit events through CqrsFramework::execute() or execute_with_metadata().
Use cqrs-es Services for side effects in handle() and follow the {Action}er -> {Domain}Service -> {Domain}Manager naming pattern.
Place command-execution logging in aggregate handle() methods rather than callers.
Model invalid states with enums, ADTs, newtypes, and typestate rather than relying on runtime validation.
Use domain newtypes at APIs and convert to SDK primitives inside the callee, except at cross-crate boundaries where conversion at the call site is necessary.
Keep visibility as restrictive as possible: private over pub(crate) over pub.
Use a three-group import order: external crates, workspace crates, then crate-internal imports; do not use function-level imports except enum variants.
Do not use unwrap() or expect() in production Rust code; they are permitted in #[cfg(test)] code.
Never create error variants containing opaque String values; prefer #[from], ?, #[source], and preserve error chains.
Log a warning or error before silent early returns such as let-else failures.
Never silently mask numeric failures with caps, fallback defaults, precision truncation, unwrap_or(), or unwrap_or_default(); use explicit checked conversions and errors.
Prefer functional patterns, pattern matching, combinators, type-driven design, and iterators over imperative loops unless complexity increases.
Use ASCII in identifiers, comments, log messages, and configuration keys; Unicode is preferred only in user-facing rendered output.
Do not use single-letter variables, arguments, closure parameters, or generic type parameters except an unambiguous lone type parameter or short unambiguous closure.
Every module must have a //! docstring and should order public API, private implementati...
Files:
crates/event-sorcery/src/sqlite_event_repository.rscrates/event-sorcery/src/lib.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/engine.rs
🔇 Additional comments (5)
crates/event-sorcery/src/engine.rs (3)
17-55: LGTM!Also applies to: 94-117, 142-144, 146-302, 385-460
705-706: LGTM!Also applies to: 710-726, 800-808, 820-821
67-92: 📐 Maintainability & Code QualityPublic error types are already exposed
JobStoreErrorandSqliteJobErrorare re-exported from the crate root, so the public engine errors remain nameable by downstream users.> Likely an incorrect or invalid review comment.crates/event-sorcery/src/lib.rs (1)
128-128: LGTM!crates/event-sorcery/src/job_sqlite.rs (1)
78-78: LGTM!Also applies to: 122-138
03c01e6 to
8983b16
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/event-sorcery/src/engine.rs (1)
778-778: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winDocument both test modules.
crates/event-sorcery/src/engine.rs#L778-L778: add an inner//!docstring.crates/event-sorcery/src/job_sqlite.rs#L109-L110: add an inner//!docstring.As per coding guidelines, every module must have a
//!docstring.🤖 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/event-sorcery/src/engine.rs` at line 778, Add an inner //! documentation comment immediately inside the tests module in crates/event-sorcery/src/engine.rs at lines 778-778, and add an equivalent descriptive //! comment inside the tests module in crates/event-sorcery/src/job_sqlite.rs at lines 109-110. Ensure both test modules are documented without changing their test behavior.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.
Outside diff comments:
In `@crates/event-sorcery/src/engine.rs`:
- Line 778: Add an inner //! documentation comment immediately inside the tests
module in crates/event-sorcery/src/engine.rs at lines 778-778, and add an
equivalent descriptive //! comment inside the tests module in
crates/event-sorcery/src/job_sqlite.rs at lines 109-110. Ensure both test
modules are documented without changing their test behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d3c6abbe-f21c-42e3-8666-fa3e8d2131fd
📒 Files selected for processing (4)
crates/event-sorcery/src/engine.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/lib.rscrates/event-sorcery/src/sqlite_event_repository.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
- GitHub Check: test
- GitHub Check: check
- GitHub Check: fmt
- GitHub Check: clippy
- GitHub Check: hooks
- GitHub Check: examples
🧰 Additional context used
📓 Path-based instructions (2)
**/*
📄 CodeRabbit inference engine (AGENTS.md)
**/*: Before work, read SPEC.md and docs/domain.md; read relevant supplemental documentation before implementation.
New features must be documented in SPEC.md before implementation and must follow the hierarchy SPEC.md -> issue -> plan -> tests -> implementation.
Fix all known problems immediately, complete all tasks, and do not allow warnings or errors to pass through.
Keep a granular task list and clear completed tasks from the active list.
All new or modified logic must have corresponding test coverage.
Understand relevant documentation and source code before implementation, keep diffs small, and review the approach critically.
When changing direction or making an important undocumented architectural decision, obtain confirmation; record significant decisions as ADRs under adrs/.
Before handover, review the diff, revert unjustified changes, and check for scope creep.
Each aggregate in a consuming application must use exactly one SqliteCqrs instance constructed at startup; per-request construction is forbidden.
Never read secret or credential files such as .env*, credentials.json, *.key, *.pem, *.p12, *.pfx, or sensitive database files without explicit permission.
Never bypass, disable, suppress, or obscure quality-control mechanisms without explicit permission; fix lint and test issues at their root.
Use cargo check, cargo nextest, and cargo clippy for verification; never use cargo build unless build artifacts are required.
Files:
crates/event-sorcery/src/lib.rscrates/event-sorcery/src/sqlite_event_repository.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/engine.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Organize code by business feature rather than technical layer; avoid catch-all modules such as types.rs, error.rs, models.rs, utils.rs, helpers.rs, and services.rs.
Never write directly to the events table; emit events through CqrsFramework::execute() or execute_with_metadata().
Use cqrs-es Services for side effects in handle() and follow the {Action}er -> {Domain}Service -> {Domain}Manager naming pattern.
Place command-execution logging in aggregate handle() methods rather than callers.
Model invalid states with enums, ADTs, newtypes, and typestate rather than relying on runtime validation.
Use domain newtypes at APIs and convert to SDK primitives inside the callee, except at cross-crate boundaries where conversion at the call site is necessary.
Keep visibility as restrictive as possible: private over pub(crate) over pub.
Use a three-group import order: external crates, workspace crates, then crate-internal imports; do not use function-level imports except enum variants.
Do not use unwrap() or expect() in production Rust code; they are permitted in #[cfg(test)] code.
Never create error variants containing opaque String values; prefer #[from], ?, #[source], and preserve error chains.
Log a warning or error before silent early returns such as let-else failures.
Never silently mask numeric failures with caps, fallback defaults, precision truncation, unwrap_or(), or unwrap_or_default(); use explicit checked conversions and errors.
Prefer functional patterns, pattern matching, combinators, type-driven design, and iterators over imperative loops unless complexity increases.
Use ASCII in identifiers, comments, log messages, and configuration keys; Unicode is preferred only in user-facing rendered output.
Do not use single-letter variables, arguments, closure parameters, or generic type parameters except an unambiguous lone type parameter or short unambiguous closure.
Every module must have a //! docstring and should order public API, private implementati...
Files:
crates/event-sorcery/src/lib.rscrates/event-sorcery/src/sqlite_event_repository.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/engine.rs
🔇 Additional comments (4)
crates/event-sorcery/src/sqlite_event_repository.rs (1)
125-125: Add the repository-level empty-snapshot regression test.This path still needs coverage proving that empty events plus a snapshot propagates the error and writes nothing.
crates/event-sorcery/src/engine.rs (1)
6-7: LGTM!Also applies to: 19-60, 69-76, 96-118, 131-542, 730-730, 824-862, 923-931, 943-944
crates/event-sorcery/src/lib.rs (1)
128-128: LGTM!crates/event-sorcery/src/job_sqlite.rs (1)
78-78: LGTM!
8983b16 to
ed8d725
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/event-sorcery/src/engine.rs`:
- Around line 129-142: Update the documentation comment for Engine::new to
describe construction from a SQLite pool without claiming the pool is already
migrated, and document the required separate migrate() call or initialization
sequence so external consumers use the correct order.
🪄 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: ASSERTIVE
Plan: Pro Plus
Run ID: 05630b1a-9adf-4bc1-92aa-37b41098196c
📒 Files selected for processing (4)
crates/event-sorcery/src/engine.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/lib.rscrates/event-sorcery/src/sqlite_event_repository.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
- GitHub Check: examples
- GitHub Check: check
- GitHub Check: clippy
- GitHub Check: fmt
- GitHub Check: hooks
- GitHub Check: test
🧰 Additional context used
📓 Path-based instructions (2)
**/*
📄 CodeRabbit inference engine (AGENTS.md)
**/*: Before work, read SPEC.md and docs/domain.md; read relevant supplemental documentation before implementation.
New features must be documented in SPEC.md before implementation and must follow the hierarchy SPEC.md -> issue -> plan -> tests -> implementation.
Fix all known problems immediately, complete all tasks, and do not allow warnings or errors to pass through.
Keep a granular task list and clear completed tasks from the active list.
All new or modified logic must have corresponding test coverage.
Understand relevant documentation and source code before implementation, keep diffs small, and review the approach critically.
When changing direction or making an important undocumented architectural decision, obtain confirmation; record significant decisions as ADRs under adrs/.
Before handover, review the diff, revert unjustified changes, and check for scope creep.
Each aggregate in a consuming application must use exactly one SqliteCqrs instance constructed at startup; per-request construction is forbidden.
Never read secret or credential files such as .env*, credentials.json, *.key, *.pem, *.p12, *.pfx, or sensitive database files without explicit permission.
Never bypass, disable, suppress, or obscure quality-control mechanisms without explicit permission; fix lint and test issues at their root.
Use cargo check, cargo nextest, and cargo clippy for verification; never use cargo build unless build artifacts are required.
Files:
crates/event-sorcery/src/lib.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/sqlite_event_repository.rscrates/event-sorcery/src/engine.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Organize code by business feature rather than technical layer; avoid catch-all modules such as types.rs, error.rs, models.rs, utils.rs, helpers.rs, and services.rs.
Never write directly to the events table; emit events through CqrsFramework::execute() or execute_with_metadata().
Use cqrs-es Services for side effects in handle() and follow the {Action}er -> {Domain}Service -> {Domain}Manager naming pattern.
Place command-execution logging in aggregate handle() methods rather than callers.
Model invalid states with enums, ADTs, newtypes, and typestate rather than relying on runtime validation.
Use domain newtypes at APIs and convert to SDK primitives inside the callee, except at cross-crate boundaries where conversion at the call site is necessary.
Keep visibility as restrictive as possible: private over pub(crate) over pub.
Use a three-group import order: external crates, workspace crates, then crate-internal imports; do not use function-level imports except enum variants.
Do not use unwrap() or expect() in production Rust code; they are permitted in #[cfg(test)] code.
Never create error variants containing opaque String values; prefer #[from], ?, #[source], and preserve error chains.
Log a warning or error before silent early returns such as let-else failures.
Never silently mask numeric failures with caps, fallback defaults, precision truncation, unwrap_or(), or unwrap_or_default(); use explicit checked conversions and errors.
Prefer functional patterns, pattern matching, combinators, type-driven design, and iterators over imperative loops unless complexity increases.
Use ASCII in identifiers, comments, log messages, and configuration keys; Unicode is preferred only in user-facing rendered output.
Do not use single-letter variables, arguments, closure parameters, or generic type parameters except an unambiguous lone type parameter or short unambiguous closure.
Every module must have a //! docstring and should order public API, private implementati...
Files:
crates/event-sorcery/src/lib.rscrates/event-sorcery/src/job_sqlite.rscrates/event-sorcery/src/sqlite_event_repository.rscrates/event-sorcery/src/engine.rs
🔇 Additional comments (8)
crates/event-sorcery/src/engine.rs (5)
6-65: LGTM!
69-127: LGTM!
144-364: Public API promotions and read-path additions look correct.
pool()correctly stayspub(crate), checked conversions (i64::try_from/usize::try_from) are used consistently inload_events_page/current_version, and bind counts match placeholder counts in both branches. One note:migrate()(line 136) returnsSqliteJobErrorwhile every other non-jobEngineop here returnsEngineError— see the lib.rs comment for the cross-file reachability concern this creates now thatEngineis public.
468-468: LGTM!Also applies to: 730-739
779-1060: Solid integration coverage; past single-connection-pool concern is resolved.The migration and paging tests correctly use
SqlitePoolOptions::new().max_connections(1)for:memory:pools, addressing the earlier review comment about private per-connection in-memory databases.snapshot_attachment_requires_persisted_eventscorrectly uses a sync#[test]sincewith_snapshotis no longer async-dependent.crates/event-sorcery/src/sqlite_event_repository.rs (1)
125-125: Resolves prior review feedback with correct implementation.
with_snapshot(...)?correctly propagates the new fallible constructor, and the newempty_snapshot_update_propagates_without_writingtest directly satisfies the earlier request for empty-snapshot regression coverage on thepersistpath (asserts the exactEngineError::EmptySnapshotUpdatevariant and zero rows written, per the guideline to assert exact error variants).Also applies to: 147-148, 292-306, 338-369
crates/event-sorcery/src/job_sqlite.rs (1)
78-78: LGTM! Delegation toEngine::migrateremoves the duplicated migrator logic, and the new test module (with its//!docstring and single-connection in-memory pool) resolves the two previously flagged review comments on this file.Also applies to: 108-146
crates/event-sorcery/src/lib.rs (1)
128-128: 🗄️ Data Integrity & IntegrationNo missing re-exports here The job-related result and error types are already re-exported from
crates/event-sorcery/src/lib.rs, andEnqueueRequeststays crate-private and is only used internally.> Likely an incorrect or invalid review comment.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Publish the extracted Engine, stream identity, commit request, snapshot update, and error types for the C ABI crate instead of creating a second storage implementation.
Engine migration now owns the existing sqlite-es MIGRATOR path, and the native SqliteBackend delegates to it. The facade remains the same cqrs-es, Apalis, SQLx, and SQLite implementation characterized downstack.
Closes #61.
This is part 7 of 32 in a stack made with GitButler:
Summary by CodeRabbit