Skip to content

Fully transition towards Effect-based DB access#269

Merged
vcarl merged 5 commits intomainfrom
vc-db-migrate
Feb 2, 2026
Merged

Fully transition towards Effect-based DB access#269
vcarl merged 5 commits intomainfrom
vc-db-migrate

Conversation

@vcarl
Copy link
Member

@vcarl vcarl commented Feb 2, 2026

No description provided.

vcarl and others added 5 commits February 2, 2026 13:11
Consolidate all database access through a single ManagedRuntime in
Database.ts. Add bridge functions (run, runTakeFirst, runTakeFirstOrThrow)
for legacy async/await code and shutdownDatabase for clean WAL
checkpointing on process exit.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
runEffect and runEffectExit now use runtime.runPromise() instead of
Effect.runPromise(), so all effects automatically receive database
access without manual DatabaseLayer provision.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
DatabaseLayer is now provided globally via ManagedRuntime, so all
Effect.provide(DatabaseLayer) and Layer.provide(DatabaseLayer) calls
are no longer needed in commands, handlers, and services.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace direct db.server.ts imports with Database module bridge
functions (run, runTakeFirst, runTakeFirstOrThrow) across all models,
routes, discord handlers, and helpers. Add explicit JSON parsing where
ParseJSONResultsPlugin was previously relied upon.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Convert setupHoneypot, setupReactjiChannel, and setupTickets to yield
DatabaseService directly instead of wrapping queries in Effect.tryPromise.
Update EFFECT.md guide and add migration notes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Preview environment removed

The preview for this PR has been cleaned up.

@vcarl vcarl merged commit 75608e4 into main Feb 2, 2026
5 checks passed
@vcarl vcarl deleted the vc-db-migrate branch February 2, 2026 18:39
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