Conversation
Co-authored-by: ichiriac <173203+ichiriac@users.noreply.github.com>
- Add ScopeBuilder class for scope normalization and merging - Add CacheAdapter interface with InMemoryCacheAdapter implementation - Extend Model class to support scopes and defaultScope - Add scope() and unscoped() methods to Model - Update Request class to apply scopes before query execution - Implement scope merging (AND for where, concat for include, last-wins for others) - Add comprehensive test suite for scopes feature - Support parameterized scopes via functions - Support defaultScope with ability to bypass via unscoped() - All existing tests still pass Co-authored-by: ichiriac <173203+ichiriac@users.noreply.github.com>
- Create detailed scopes.md guide covering all scope features - Update models.md to reference scopes - Update requests.md with scope examples and caching - Enhance adoption-sequelize.md with detailed scope migration guide - Update filtering.md to mention scopes as first option - Update README.md with scopes feature highlights - All tests still passing (324 tests) Co-authored-by: ichiriac <173203+ichiriac@users.noreply.github.com>
- Fix cache eviction timestamp comparison logic in InMemoryCacheAdapter - Add TODO comment for extractOptionsFromRequest incomplete implementation - Make ScopeBuilder scopes and defaultScope properties public readonly - Update Model.ts to use public properties instead of bracket notation - Improve TODO comment placement in Request.ts for bulk eager loading - All 324 tests still passing Co-authored-by: ichiriac <173203+ichiriac@users.noreply.github.com>
- Create interactive demo showcasing all scope features - Demonstrate basic, parameterized, and composed scopes - Show default scope behavior and unscoped() usage - Include scope-level caching examples - Add demo README with instructions - Demo successfully runs and outputs expected results Co-authored-by: ichiriac <173203+ichiriac@users.noreply.github.com>
- Replace Object.defineProperty with static _name in demo models - Use instance.write() instead of bulk update for soft delete - Demo works correctly with all functionality preserved - All 324 tests passing Co-authored-by: ichiriac <173203+ichiriac@users.noreply.github.com>
- Allow { scopeName: value } in addition to { scopeName: [value] }
- Silently convert single value to array for convenience
- Update demo to use more natural syntax
- Add test for both single value and array syntax
- Update documentation with both syntaxes
- Backward compatible: array syntax still works
- All 326 tests passing (13 scope tests)
Co-authored-by: ichiriac <173203+ichiriac@users.noreply.github.com>
Add model scopes for reusable query filters with default scope support
Owner
Author
|
@copilot update the mixin documentation by providing timestamps mixins, and softdelete examples with overwriting the unlink method - and also how to use mixins on models |
Contributor
… examples Co-authored-by: ichiriac <173203+ichiriac@users.noreply.github.com>
Co-authored-by: ichiriac <173203+ichiriac@users.noreply.github.com>
Add comprehensive mixin documentation with timestamps and soft delete patterns
Replaced forceUnlink with super.unlink for soft delete.
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.