Conversation
This allows tagsAccessor to use fast object matching and indexing lookup.
This allows to specify generic stream indexing properties in the options, which the store will make sure are indexed in dedicated streams.
| path | getPropertyAtPath | compileAccessor | factor | |----------------------|------------------:|----------------:|-------:| | 'type' | 84 ns | 12 ns | ~7× | | 'meta.kind' | 120 ns | 41 ns | ~3× | | 'meta.nested.value' | 150 ns | 65 ns | ~2.3× |
…ontainment in streams.md
|
@copilot the new matcher semantic for includes needs to be added to the bufferMatcher as well. However, since the input value is not distinctive from exact single property matching, this would lead to this casing needing to do alternative checks, which in turn makes that (most common) case much slower. Add an implementation for that and adjust the documentation accordingly, mentioning the new $has operator and explain how to use that in DCB when not using tagsAccessor streams as an alternative that is more performant than a matcher function. |
Done. Summary of changes:
All 663 tests pass; CodeQL is clean. |
|
@copilot improve code coverage of all newly added/changed code in this PR |
Added tests covering the previously-uncovered branches in newly-added PR code:
Coverage on the changed source files:
Remaining uncovered lines in the changed files are all pre-existing code from |
This pull request introduces several major improvements to EventStore's querying capabilities, focusing on DCB (Dynamic Consistency Boundary) support, dynamic stream indexing, and enhanced documentation. The most important changes include a new generic
streamSourcesmechanism for automatic stream indexing, the addition oftagsAccessorfor tag-based streams, a new DCB query shorthand syntax, and comprehensive updates to the documentation explaining these features and their trade-offs.Dynamic Stream Indexing and Query Enhancements
streamSourcesconfiguration option, allowing users to define custom stream indexes for any payload property. This enables automatic maintenance of dedicated streams for properties like tenant IDs, types, or tags, with O(1) index routing. (src/EventStore.js[1] [2]tagsAccessoroption as a shorthand for creating tag-based streams from an array property in the payload. This supports efficient tag queries and is integrated with DCB query resolution. (src/EventStore.js[1] [2]store.query({ items: [{ types, tags }] })can now be used instead of manually constructing the nested selector algebra. This requirestypeAccessorand/ortagsAccessorto be configured. (src/EventStore.js[1] [2] [3]Documentation Updates
typeAccessorandtagsAccessor, and the difference between matcher-only and tag-stream queries. Includes practical examples, trade-off discussions, and advanced selector algebra details. (docs/dcb.md[1] [2] [3] [4] [5] [6] [7]streamSources,typeAccessor, andtagsAccessoroptions. (docs/advanced.mddocs/advanced.mdR63-R95)tagsAccessor, andstreamSources. Also noted a minor bugfix inJoinStream. (docs/changelog.mddocs/changelog.mdR7-R13)These changes make it much easier to configure and use DCB-style queries, improve performance for high-cardinality or high-throughput use cases, and provide clear guidance on when to use matcher-only versus stream-indexed queries.