Add in-memory storage mode (default) and storage option; update README#6
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74c9877bf4
ℹ️ 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".
| const useMemoryStorage = options.storage !== 'sqlite'; | ||
| const dbPath = useMemoryStorage ? ':memory:' : (options.dbPath || 'blazerjob.db'); |
There was a problem hiding this comment.
Keep dbPath-only callers on SQLite storage
The new default const useMemoryStorage = options.storage !== 'sqlite' makes existing new BlazeJob({ dbPath: ... }) callers silently switch to :memory: because storage is usually omitted. In this repo, src/bin/cli.ts still uses dbPath-only construction for schedule, list, and delete, so tasks written by one CLI invocation are no longer visible to the next process, breaking persistence semantics. This is a behavioral regression for existing integrations and should be fixed by inferring SQLite when dbPath is provided unless storage: 'memory' is explicitly set.
Useful? React with 👍 / 👎.
…ly (MAJOR BREAKING CHANGE) - Remove all Cosmos-related code and dependencies - Remove unsupported task types (shell, onchain, solana, email, fintech) - Simplify types to only support HTTP and custom tasks - Update README to English and remove Cosmos documentation - Add storage mode documentation (memory vs sqlite) - Add HTTP server documentation - Fix WAL mode to only apply to file storage - Fix memory leaks on task deletion - Update CLI to use deleteTask method - Clean up .env.example - Remove blockchain keyword from package.json
Motivation
storageoption to allow choosing between in-memory and SQLite-backed persistence.README(French additions).Description
storage?: 'sqlite' | 'memory'toBlazeJobOptionsand makedbPathoptional, and derivedbPathfromstoragewith:memory:used for memory mode.const useMemoryStorage = options.storage !== 'sqlite'and callnew Database(dbPath)accordingly.startServerto createjobs = new BlazeJob({ storage: 'memory' })by default and reuse the scheduler's DB instance viadb = jobs['db']instead of creating a separateDatabase('blazerjob.db')instance.dbPathoptional.README.mdwith examples showing the default RAM mode and how to enable SQLite persistence, with code snippets in TypeScript and French explanatory text.Testing
tscand the build completed successfully.npm testand all automated tests passed.npm run lintand it reported no issues.Codex Task