-
Notifications
You must be signed in to change notification settings - Fork 0
Add FileSystem driver with one JSON file per table #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: huangyiirene <[email protected]>
Co-authored-by: huangyiirene <[email protected]>
Co-authored-by: huangyiirene <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
@copilot 审查代码并修复,更新文档 |
…y methods, Chinese docs, and enhanced error handling Co-authored-by: huangyiirene <[email protected]>
代码已审查并改进完成(commit: 55465cf): 新增功能:
改进:
所有测试通过 ✓ |
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.