Fully transition towards Effect-based DB access#269
Merged
Conversation
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>
Preview environment removedThe preview for this PR has been cleaned up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.