Add FileSystem driver with one JSON file per table#109
Merged
huangyiirene merged 5 commits intomainfrom Jan 16, 2026
Merged
Conversation
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add file system based startup with JSON files for each table
Add FileSystem driver with one JSON file per table
Jan 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new file-based persistence driver (@objectql/driver-fs) for ObjectQL that stores each object type as a separate JSON file, providing a lightweight alternative to traditional database drivers for development and small-scale applications.
Changes:
- Implements a complete FileSystem driver with atomic write operations, backup support, and in-memory caching
- Adds comprehensive test coverage (29 test cases) for CRUD operations, query filters, bulk operations, and edge cases
- Includes a working example demonstrating real-world usage with projects management
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/drivers/fs/src/index.ts | Core driver implementation with full Driver interface support and query operations |
| packages/drivers/fs/test/index.test.ts | Comprehensive test suite covering CRUD, queries, bulk operations, and file system behavior |
| packages/drivers/fs/package.json | Package configuration with workspace dependencies |
| packages/drivers/fs/tsconfig.json | TypeScript configuration for the driver package |
| packages/drivers/fs/jest.config.js | Jest test configuration with module mapping |
| packages/drivers/fs/README.md | Complete documentation with examples, API reference, and usage guidelines |
| packages/drivers/fs/CHANGELOG.md | Initial release changelog |
| examples/drivers/fs-demo/src/index.ts | Demo application showing practical usage patterns |
| examples/drivers/fs-demo/package.json | Demo package configuration |
| examples/drivers/fs-demo/tsconfig.json | TypeScript configuration for demo |
| examples/drivers/fs-demo/README.md | Demo documentation and usage instructions |
| examples/drivers/fs-demo/.gitignore | Excludes runtime-generated data directory |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Contributor
|
@copilot 审查代码并修复,更新文档 |
…y methods, Chinese docs, and enhanced error handling Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Contributor
Author
代码已审查并改进完成(commit: 55465cf): 新增功能:
改进:
所有测试通过 ✓ |
huangyiirene
approved these changes
Jan 16, 2026
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.
Implements a file-based persistence driver where each ObjectQL object type is stored as a separate JSON file (e.g.,
users.json,projects.json).Implementation
New Package:
@objectql/driver-fs.bakfiles on write operationsinitialDataconfigclear(),clearAll(),invalidateCache(),getCacheSize()Usage
File Format
Test Coverage
examples/drivers/fs-demoDocumentation
Limitations
Not recommended for:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.