Commit fe84352
authored
fix(fumadb): mirror aggregate review hardening (#62)
## Summary
Mirrors the review-hardening deltas from upstream
[RhysSullivan#1119](RhysSullivan#1119)
onto `dev`.
`dev` already contains the broader FumaDB aggregate and keyset query
feature, so this PR only carries the remaining drift from the upstream
review loop.
## Changes
- Preserve memory and Drizzle parity for empty composite filters by
compiling empty JSON `or` filters to a constant false SQL predicate.
- Add regression coverage for empty `or` and empty `and` filters across
the aggregate harness.
- Replace nested plugin-storage operator selection with an explicit
typed JSON compare-operator map.
- Document SQLite percentile behavior on the public FumaDB and
plugin-storage stats inputs.
## Intentional Differences From Upstream RhysSullivan#1119
- This PR does not re-add the full aggregate and keyset implementation
because `dev` already has that feature surface.
- This PR does not touch the OpenAPI storage facade mock because `dev`
already has the mock shape needed by the expanded collection facade.
- This PR has no changeset because it only mirrors fixes to an existing
`dev` feature surface.
## Tests
- `bun run bootstrap`
- `bun run --cwd packages/core/fumadb test --
src/query/aggregate.test.ts src/query/table-policy.test.ts`
- `bun run --cwd packages/core/sdk test --
src/plugin-storage-aggregate.test.ts src/plugin-storage.test.ts`
- `bun run --cwd packages/core/fumadb typecheck`
- `bun run --cwd packages/core/sdk typecheck`
- `bun run typecheck`
- `./node_modules/.bin/oxfmt --check
packages/core/fumadb/src/adapters/drizzle/query.ts
packages/core/fumadb/src/query/aggregate.test.ts
packages/core/fumadb/src/query/aggregate.ts
packages/core/sdk/src/executor.ts
packages/core/sdk/src/plugin-storage.ts`1 parent 50bed06 commit fe84352
5 files changed
Lines changed: 56 additions & 11 deletions
File tree
- packages/core
- fumadb/src
- adapters/drizzle
- query
- sdk/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| 365 | + | |
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
131 | 149 | | |
132 | 150 | | |
133 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
155 | 161 | | |
156 | 162 | | |
157 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
158 | 171 | | |
159 | 172 | | |
160 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
1116 | 1117 | | |
1117 | 1118 | | |
1118 | 1119 | | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1119 | 1131 | | |
1120 | 1132 | | |
1121 | 1133 | | |
| |||
1212 | 1224 | | |
1213 | 1225 | | |
1214 | 1226 | | |
| 1227 | + | |
1215 | 1228 | | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
1223 | | - | |
1224 | | - | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1225 | 1232 | | |
1226 | 1233 | | |
1227 | 1234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
229 | 235 | | |
230 | 236 | | |
231 | 237 | | |
| |||
0 commit comments