|
2 | 2 |
|
3 | 3 | ## General
|
4 | 4 |
|
| 5 | +- use JSDoc to move types back to implementations as much as possible, so subclassing etc works |
| 6 | + - probably everything we need is covered by JSDoc now |
5 | 7 | - allow using https://github.com/rqlite/rqlite-js as a backend for a distributed DB
|
6 | 8 | - Change the multi-access tests to use `"file:memdb1?mode=memory&cache=shared"` for shared access to the same in-memory db (probably when using better-sqlite, it requires file uri support)
|
7 | 9 | - Give DB and ESDB the same API for registering models (.addModel)
|
|
55 | 57 |
|
56 | 58 | ### Important
|
57 | 59 |
|
58 |
| -- [x] .each should get concurrent=5 parameter |
59 |
| - - concurrent workers process in-memory queue |
60 |
| - - batchSize=50 indicates how many results to load in memory for processing |
61 | 60 | - [ ] .each() limit should apply to total fetched, breaking change
|
62 |
| -- [ ] FTS5 support for text searching |
63 |
| - - Real columns marked `textSearch: true|string|object` generate a FTS5 index |
64 |
| - - one index per textSearch value ("tag") |
| 61 | +- FTS5 support for text searching on columns |
65 | 62 | - It uses the table as a backing table
|
66 |
| - - FTS options can be passed as an object with `tag` for the textSearch value |
67 |
| - - Searching passes the search argument to the tagged FTS5 index limited to the column |
68 |
| - - Changes are applied by JM, not triggers. Generating |
69 |
| - The tags are there to allow multilingual searching. Another column should be added to allow searching all columns in the tagged index. |
70 |
| - Need to come up with nicer configuration keys. Also something for custom tokenizing |
| 63 | + - Real columns marked `fts: true|object` generate a FTS5 index |
| 64 | + - `true` is shorthand for `{group: 'all', allColumns: false}` |
| 65 | + - `group` is a name for the index so you can group columns in separate indexes, for example by language |
| 66 | + - `allColumns`, if true, means to search all columns for this group. This can be used on non-real columns |
| 67 | + - Content columns have to be real columns, otherwise FTS5 can't refer to them. So, throw an error if the column not real except if `allColumns: true`. |
| 68 | + - `textSearch: true` should be deprecated and means `fts: {group: 'all'}` if `real: true` |
| 69 | + - other options could be added to configure tokenizing |
| 70 | + - one index per `fts.group` value (, defaults to `'all'`) |
| 71 | + - Searching passes the search argument to the FTS5 index of the group |
| 72 | + - The search is limited to the column unless `allColumns: true` |
| 73 | + - ¿Updates to the FTS index are applied by JsonModel, not triggers? why/why not |
71 | 74 | - [ ] columns using the same path should get the same JSON path. There are some edge cases.
|
72 | 75 | - [ ] falsyBool paging doesn't work because it tries to >= and that fails for null. It should add a "sortable: false" flag
|
73 | 76 |
|
|
80 | 83 | - [ ] recreate index if expression changes
|
81 | 84 | - [ ] indexes: `[{expression, where}]` extra indexes
|
82 | 85 | - [ ] auto-delete other indexes, API change
|
83 |
| -- [x] if column value is function, call with `({columnName})` => helpers |
| 86 | +- column helpers: |
84 | 87 | - [ ] objectColumn() helper -> type=JSON, NULL === {}, stringify checks if object (char 0 is `{`)
|
85 | 88 | - [ ] boolColumn() -> `type="INTEGER"; parse = Boolean; stringify=Boolean`
|
86 | 89 | - [ ] falsyColumn() -> implement falsyBool
|
|
118 | 121 |
|
119 | 122 | ### Nice to have
|
120 | 123 |
|
121 |
| -- [x] provide event creators for each type of change |
122 | 124 | - [ ] .get for the RO ESModel uses .getCached, with a caching-map limiting the amount, cleared when the version changes
|
123 | 125 | - [ ] .changeId (`mv:[[oldId, newId],…]` apply action?)
|
124 | 126 |
|
|
130 | 132 | - Ideally, the results go in a different db that can be split at will.
|
131 | 133 | - for multi-process, lock the result db exclusively to worker
|
132 | 134 | - re-processing events clears all subevent rows
|
133 |
| -- [x] Add `transact` phase after the other phases, in which `dispatch` works as well as ESModel dispatches. This enables easier event handling with ESModel changes. |
134 | 135 | - [ ] Add `beforeApply` phase which runs after all reducers ran so it has access to the state of the DB before the changes are applied.
|
135 | 136 |
|
136 | 137 | ### Nice to have
|
137 | 138 |
|
138 |
| -- [x] allow passing events to dispatch as objects with type |
139 | 139 | - [ ] add eventSpy, e.g. `eSDB.debug(boolean|{filter()})`
|
140 | 140 | - [ ] in non-prod, randomly run preprocessor twice (keep event in memory and restart handling) to verify repeatability
|
141 | 141 | - [ ] don't store empty result sub-events
|
|
0 commit comments