Skip to content

Add SQLite event store documentation#503

Merged
alexeyzimarev merged 1 commit intodevfrom
docs-sqlite-event-store
Mar 3, 2026
Merged

Add SQLite event store documentation#503
alexeyzimarev merged 1 commit intodevfrom
docs-sqlite-event-store

Conversation

@alexeyzimarev
Copy link
Contributor

Summary

  • Add new SQLite infrastructure provider docs page (docs/infra/sqlite/)
  • Add SQLite to event store implementations list, supported projectors list, packages table, and checkpoint store docs
  • Reference SQLite alongside PostgreSQL and SQL Server across all relevant pages

Follows up on #502 which added the SQLite event store implementation.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@qodo-free-for-open-source-projects
Copy link
Contributor

Review Summary by Qodo

Add SQLite event store documentation and references

📝 Documentation

Grey Divider

Walkthroughs

Description
• Add comprehensive SQLite event store documentation page
• Update event store implementations list to include SQLite
• Add SQLite to supported projectors and packages table
• Document SQLite checkpoint store configuration
Diagram
flowchart LR
  A["SQLite Event Store"] -->|"New docs page"| B["docs/infra/sqlite/index.md"]
  A -->|"Referenced in"| C["Event Store Implementations"]
  A -->|"Referenced in"| D["Supported Projectors"]
  A -->|"Referenced in"| E["Packages Table"]
  A -->|"Referenced in"| F["Checkpoint Store Docs"]
Loading

Grey Divider

File Changes

1. docs/docs/infra/sqlite/index.md 📝 Documentation +157/-0

New SQLite event store documentation page

• New comprehensive documentation page for SQLite event store implementation
• Covers data model with single table design using {schema}_messages and {schema}_streams tables
• Includes event persistence setup with AddEventuousSqlite extension method
• Documents global and stream subscriptions with continuous polling approach
• Provides checkpoint store configuration and SQLite projector examples

docs/docs/infra/sqlite/index.md


2. docs/docs/persistence/event-store.md 📝 Documentation +2/-1

Add SQLite to event store implementations list

• Add SQLite to the list of supported event store implementations
• Position SQLite before Elasticsearch in the ordered list

docs/docs/persistence/event-store.md


3. docs/docs/prologue/introduction.md 📝 Documentation +3/-2

Add SQLite to introduction and packages table

• Add SQLite to aggregate persistence capabilities description
• Add SQLite to real-time subscriptions description
• Add Eventuous.Sqlite package to NuGet packages table with event store, subscriptions, and
 projections support

docs/docs/prologue/introduction.md


View more (2)
4. docs/docs/read-models/supported-projectors.md 📝 Documentation +1/-0

Add SQLite to supported projectors list

• Add SQLite projections to the list of supported projection targets
• Link to SQLite projections section in main documentation

docs/docs/read-models/supported-projectors.md


5. docs/docs/subscriptions/checkpoint/index.mdx 📝 Documentation +6/-2

Add SQLite checkpoint store documentation

• Add SQLite checkpoint store documentation section
• Explain {schema}_checkpoints table naming convention
• Document automatic table creation with initializeDatabase: true
• Minor formatting fix to PostgreSQL checkpoint store SQL

docs/docs/subscriptions/checkpoint/index.mdx


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Contributor

qodo-free-for-open-source-projects bot commented Mar 3, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. StreamName set from string 🐞 Bug ✓ Correctness
Description
The SQLite stream subscription example assigns a string to SqliteStreamSubscriptionOptions.Stream,
but that property is a StreamName and there is no implicit conversion from string. Copy/pasting
the snippet will not compile.
Code

docs/docs/infra/sqlite/index.md[R88-93]

+builder.Services.AddSubscription<SqliteStreamSubscription, SqliteStreamSubscriptionOptions>(
+    "StreamSubscription",
+    builder => builder
+        .Configure(x => x.Stream = "my-stream")
+        .AddEventHandler<StreamSubscriptionHandler>()
+);
Evidence
The docs configure Stream with a string literal, but the options type requires StreamName, and
StreamName only defines an implicit conversion *to* string (not from string), so the assignment
cannot compile.

docs/docs/infra/sqlite/index.md[88-93]
src/Sqlite/src/Eventuous.Sqlite/Subscriptions/SqliteStreamSubscription.cs[74-76]
src/Core/src/Eventuous.Shared/Store/StreamName.cs[7-35]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The docs example for `SqliteStreamSubscriptionOptions` sets `Stream` with a string literal, but the property type is `StreamName` and there is no implicit conversion from `string` to `StreamName`.

### Issue Context
This causes a compile-time error for anyone following the documentation.

### Fix Focus Areas
- docs/docs/infra/sqlite/index.md[85-94]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. SQLite FK references wrong table 🐞 Bug ✓ Correctness
Description
The SQLite schema snippet references streams(stream_id) even though Eventuous uses schema-prefixed
table names (e.g. eventuous_streams). Users manually creating tables from the snippet would end up
with an invalid foreign key reference.
Code

docs/docs/infra/sqlite/index.md[R18-22]

+global_position INTEGER PRIMARY KEY AUTOINCREMENT,
+message_id      TEXT    NOT NULL,
+message_type    TEXT    NOT NULL,
+stream_id       INTEGER NOT NULL REFERENCES streams(stream_id),
+stream_position INTEGER NOT NULL,
Evidence
The implementation’s schema script creates {schema}_streams and {schema}_messages, and the FK
references the prefixed streams table. The docs snippet omits the prefix and points at a
non-existent streams table.

docs/docs/infra/sqlite/index.md[18-25]
src/Sqlite/src/Eventuous.Sqlite/Scripts/1_Schema.sql[1-19]
src/Sqlite/src/Eventuous.Sqlite/Schema.cs[39-45]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The SQLite schema example uses `REFERENCES streams(stream_id)` but the real schema uses `{schema}_streams` (e.g. `eventuous_streams`).

### Issue Context
This can lead users who provision the schema manually to create an invalid FK.

### Fix Focus Areas
- docs/docs/infra/sqlite/index.md[13-31]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Checkpoint creation dependency unclear 🐞 Bug ⛯ Reliability
Description
Checkpoint docs suggest the SQLite checkpoint table is created automatically, but in code it’s only
created by the SQLite schema initializer when InitializeDatabase is enabled. If a user registers
SqliteCheckpointStore without initializing the schema, subscriptions will fail at runtime when the
table is missing.
Code

docs/docs/subscriptions/checkpoint/index.mdx[R99-102]

+#### SQLite
+
+The SQLite checkpoint store uses a `{schema}_checkpoints` table (default: `eventuous_checkpoints`), with the subscription id as the row key. The table is created automatically when `initializeDatabase: true` is set.
+
Evidence
The schema initializer runs only when InitializeDatabase is true, and the schema scripts create
the checkpoints table. SqliteCheckpointStore itself does not create tables; it immediately
queries/inserts into {schema}_checkpoints, which will fail if the schema wasn’t created.

docs/docs/subscriptions/checkpoint/index.mdx[99-102]
src/Sqlite/src/Eventuous.Sqlite/SchemaInitializer.cs[12-16]
src/Sqlite/src/Eventuous.Sqlite/Scripts/1_Schema.sql[23-26]
src/Sqlite/src/Eventuous.Sqlite/Subscriptions/SqliteCheckpointStore.cs[35-56]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Docs imply the SQLite checkpoint table is created automatically, but it’s only created when the SQLite schema initializer runs (InitializeDatabase=true). Otherwise the checkpoint store will query a non-existent table.

### Issue Context
This can cause runtime failures for subscriptions when users disable initialization or register the checkpoint store independently.

### Fix Focus Areas
- docs/docs/subscriptions/checkpoint/index.mdx[99-102]
- docs/docs/infra/sqlite/index.md[96-105]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@alexeyzimarev alexeyzimarev merged commit 712e281 into dev Mar 3, 2026
1 of 2 checks passed
@alexeyzimarev alexeyzimarev deleted the docs-sqlite-event-store branch March 3, 2026 13:59
Comment on lines +88 to +93
builder.Services.AddSubscription<SqliteStreamSubscription, SqliteStreamSubscriptionOptions>(
"StreamSubscription",
builder => builder
.Configure(x => x.Stream = "my-stream")
.AddEventHandler<StreamSubscriptionHandler>()
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Streamname set from string 🐞 Bug ✓ Correctness

The SQLite stream subscription example assigns a string to SqliteStreamSubscriptionOptions.Stream,
but that property is a StreamName and there is no implicit conversion from string. Copy/pasting
the snippet will not compile.
Agent Prompt
### Issue description
The docs example for `SqliteStreamSubscriptionOptions` sets `Stream` with a string literal, but the property type is `StreamName` and there is no implicit conversion from `string` to `StreamName`.

### Issue Context
This causes a compile-time error for anyone following the documentation.

### Fix Focus Areas
- docs/docs/infra/sqlite/index.md[85-94]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +18 to +22
global_position INTEGER PRIMARY KEY AUTOINCREMENT,
message_id TEXT NOT NULL,
message_type TEXT NOT NULL,
stream_id INTEGER NOT NULL REFERENCES streams(stream_id),
stream_position INTEGER NOT NULL,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Sqlite fk references wrong table 🐞 Bug ✓ Correctness

The SQLite schema snippet references streams(stream_id) even though Eventuous uses schema-prefixed
table names (e.g. eventuous_streams). Users manually creating tables from the snippet would end up
with an invalid foreign key reference.
Agent Prompt
### Issue description
The SQLite schema example uses `REFERENCES streams(stream_id)` but the real schema uses `{schema}_streams` (e.g. `eventuous_streams`).

### Issue Context
This can lead users who provision the schema manually to create an invalid FK.

### Fix Focus Areas
- docs/docs/infra/sqlite/index.md[13-31]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbff75c032

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

builder.Services.AddSubscription<SqliteAllStreamSubscription, SqliteAllStreamSubscriptionOptions>(
"ImportedBookingsProjections",
builder => builder
.UseCheckpointStore<SqliteCheckpointStore>()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid unusable checkpoint-store registration in SQLite sample

Using .UseCheckpointStore<SqliteCheckpointStore>() is not valid for the SQLite implementation because UseCheckpointStore<T>() relies on DI to construct T, while SqliteCheckpointStore only exposes constructors that need either raw string parameters or a SqliteCheckpointStoreOptions instance; this causes subscription resolution to fail at startup when readers copy this snippet. The sample should use the already-documented AddSqliteCheckpointStore() default registration or a factory-based UseCheckpointStore(...) that resolves a preconfigured store.

Useful? React with 👍 / 👎.

builder.Services.AddSubscription<SqliteStreamSubscription, SqliteStreamSubscriptionOptions>(
"StreamSubscription",
builder => builder
.Configure(x => x.Stream = "my-stream")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Assign a StreamName value in stream subscription example

This example does not compile as written: SqliteStreamSubscriptionOptions.Stream is a StreamName, and StreamName does not define an implicit conversion from string, so x.Stream = "my-stream" produces a type-mismatch error for users following the docs. The snippet should construct a StreamName explicitly (or use a documented factory) before assignment.

Useful? React with 👍 / 👎.

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.

1 participant