@mistriwork/engine 1.0.0-rc.18 → 1.0.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/postgres.d.ts +3 -26
- package/dist/adapters/postgres.js +22 -20
- package/dist/adapters/postgresTransactionOpening.d.ts +39 -0
- package/dist/adapters/postgresTransactionOpening.js +16 -0
- package/dist/adapters/scoped/scopedReads.js +29 -8
- package/dist/adapters/scoped/scopedTransaction.d.ts +3 -1
- package/dist/adapters/scoped/scopedTransaction.js +73 -5
- package/dist/adapters/scoped/triggerProof.js +5 -1
- package/dist/adapters/sqlite.d.ts +1 -0
- package/dist/adapters/sqlite.js +19 -3
- package/dist/server/clientHttp.d.ts +1 -0
- package/dist/server/clientHttp.js +23 -3
- package/dist/server/columnGrants.js +6 -1
- package/dist/server/http/context.d.ts +5 -0
- package/dist/shared/aggregate.d.ts +1 -1
- package/dist/shared/aggregate.js +2 -2
- package/dist/shared/anyRows.d.ts +19 -0
- package/dist/shared/anyRows.js +69 -0
- package/dist/shared/breakdown.d.ts +4 -2
- package/dist/shared/breakdown.js +11 -8
- package/dist/shared/filter.d.ts +40 -1
- package/dist/shared/filter.js +54 -4
- package/dist/shared/rowScope.d.ts +44 -3
- package/dist/shared/rowScope.js +349 -51
- package/dist/shared/servedApp.d.ts +5 -0
- package/dist/shared/theme.js +22 -3
- package/dist/shared/themeRecipes.d.ts +1 -1
- package/dist/shared/themeRecipes.js +1 -0
- package/dist/shared/view.d.ts +4 -2
- package/dist/shared/view.js +6 -4
- package/package.json +1 -1
- package/schema/theme.d.ts +1 -0
package/dist/shared/view.js
CHANGED
|
@@ -189,14 +189,16 @@ function alias(name, n) {
|
|
|
189
189
|
* columns, then the filter, then the sort. Aliases are handed out on first
|
|
190
190
|
* use, so the same view always produces the same statement.
|
|
191
191
|
*/
|
|
192
|
-
export function compileView(schema, view, style, offset = 0, scope
|
|
192
|
+
export function compileView(schema, view, style, offset = 0, scope,
|
|
193
|
+
/** The catalog a row scope's `via` targets resolve in, where the reader's own is pruned (rowScope.ts ScopedRelations). */
|
|
194
|
+
policy = schema) {
|
|
193
195
|
// The App's soft keys, where this catalog is the database's own (declaredReferences.ts).
|
|
194
196
|
schema = withViewReferences(schema, view.references);
|
|
195
197
|
const base = findTable(schema, view.base);
|
|
196
198
|
if (!base) {
|
|
197
199
|
throw new PathError(`No table called "${view.base}" in this database, so the view has nothing to start from.`, view.base, view.base, 0);
|
|
198
200
|
}
|
|
199
|
-
const relations = new ScopedRelations(schema, style, scope);
|
|
201
|
+
const relations = new ScopedRelations(schema, style, scope, policy);
|
|
200
202
|
const baseRelation = relations.table(base.id);
|
|
201
203
|
const plan = new JoinPlan(schema, base, style, relations.table);
|
|
202
204
|
const { resolve, qualify, membership, exists, typeOf } = viewPaths(schema, view, plan, style, relations);
|
|
@@ -755,13 +757,13 @@ function anyRowsOf(schema, base, body, now, options, anys, extra) {
|
|
|
755
757
|
* design rests on: a view never multiplies, so counting it is counting the
|
|
756
758
|
* table it started from. With `limit`, it stops after that many.
|
|
757
759
|
*/
|
|
758
|
-
export function compileViewCount(schema, view, style, scope, limit) {
|
|
760
|
+
export function compileViewCount(schema, view, style, scope, limit, policy = schema) {
|
|
759
761
|
schema = withViewReferences(schema, view.references);
|
|
760
762
|
const base = findTable(schema, view.base);
|
|
761
763
|
if (!base) {
|
|
762
764
|
throw new PathError(`No table called "${view.base}" in this database, so the view has nothing to start from.`, view.base, view.base, 0);
|
|
763
765
|
}
|
|
764
|
-
const relations = new ScopedRelations(schema, style, scope);
|
|
766
|
+
const relations = new ScopedRelations(schema, style, scope, policy);
|
|
765
767
|
const baseRelation = relations.table(base.id);
|
|
766
768
|
const plan = new JoinPlan(schema, base, style, relations.table);
|
|
767
769
|
const { qualify, membership, exists, typeOf } = viewPaths(schema, view, plan, style, relations);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mistriwork/engine",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.20",
|
|
4
4
|
"description": "The engine both products stand on: the adapters (SQLite, Postgres), the catalog, the query language, keyset pages, the HTTP kit and the shared rules. No React.",
|
|
5
5
|
"homepage": "https://mistriwork.dev",
|
|
6
6
|
"bugs": {
|