clivly 0.9.5 → 0.9.7
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/README.md +22 -3
- package/core-auth-adapter.cjs +1 -1
- package/core-auth-adapter.mjs +1 -1
- package/core-drizzle.cjs +1 -1
- package/core-drizzle.d.cts +1 -1
- package/core-drizzle.d.mts +1 -1
- package/core-drizzle.mjs +1 -1
- package/core-entity-config.cjs +1 -1
- package/core-entity-config.mjs +1 -1
- package/core-mapping-form.cjs +1 -1
- package/core-mapping-form.mjs +1 -1
- package/core-mappings-config.cjs +1 -1
- package/core-mappings-config.mjs +1 -1
- package/core-sync-engine.cjs +1 -1
- package/core-sync-engine.mjs +1 -1
- package/core-view-compiler.cjs +1 -1
- package/core-view-compiler.mjs +1 -1
- package/core.cjs +14 -9
- package/core.d.cts +2 -2
- package/core.d.mts +2 -2
- package/core.mjs +9 -9
- package/{drizzle-CiK8MMEZ.d.mts → drizzle-BmDDgAIF.d.mts} +3 -1
- package/{drizzle-bfjVzYR6.cjs → drizzle-DcB7OfBp.cjs} +9 -1
- package/{drizzle-DEtRrqtc.d.cts → drizzle-ixVV4pPN.d.cts} +3 -1
- package/{drizzle-3kvhkwO7.mjs → drizzle-wbcuG-cy.mjs} +9 -1
- package/drizzle.cjs +61 -10
- package/drizzle.d.cts +9 -3
- package/drizzle.d.mts +9 -3
- package/drizzle.mjs +61 -10
- package/{entity-config-B74SPOUZ.mjs → entity-config-C8IIkrmX.mjs} +34 -5
- package/{entity-config-7sGCk_nw.cjs → entity-config-CPM-Tp-d.cjs} +34 -5
- package/index.cjs +41 -9
- package/index.mjs +41 -9
- package/internal-BLKMnIIZ.cjs +259 -0
- package/internal-BpVh_J77.mjs +212 -0
- package/{internal-o2M7FGlR.d.mts → internal-CvlFk3KC.d.mts} +82 -2
- package/{internal-wCXSELDN.d.cts → internal-DGUOLQAq.d.cts} +82 -2
- package/internal-drizzle.cjs +1 -1
- package/internal-drizzle.d.cts +1 -1
- package/internal-drizzle.d.mts +1 -1
- package/internal-drizzle.mjs +1 -1
- package/internal-entity-config.cjs +1 -1
- package/internal-entity-config.mjs +1 -1
- package/internal-entity-heuristics.cjs +1 -1
- package/internal-entity-heuristics.mjs +1 -1
- package/internal-mappings-config.cjs +1 -1
- package/internal-mappings-config.mjs +1 -1
- package/internal-sync-engine.cjs +1 -1
- package/internal-sync-engine.mjs +1 -1
- package/internal-view-compiler.cjs +1 -1
- package/internal-view-compiler.mjs +1 -1
- package/internal.cjs +13 -7
- package/internal.d.cts +2 -2
- package/internal.d.mts +2 -2
- package/internal.mjs +8 -8
- package/{mappings-config-CLyEg0sf.cjs → mappings-config-CBwL3FVh.cjs} +1 -1
- package/{mappings-config-DQS_s4dg.mjs → mappings-config-DUKBe6OS.mjs} +1 -1
- package/{namespace-probe-Cn7voAd0.d.mts → namespace-probe-BQ4imnV7.d.mts} +85 -2
- package/{namespace-probe-BoGI18dQ.d.cts → namespace-probe-DZIGdvlm.d.cts} +85 -2
- package/package.json +1 -1
- package/{projection-Dz6_i1-w.cjs → projection-DEwL-D8R.cjs} +6 -0
- package/{projection-CSGJbZlZ.mjs → projection-hnPSgH6G.mjs} +1 -1
- package/{projection-sql-BgnfiGqF.mjs → projection-sql-9zzTVGvf.mjs} +34 -2
- package/{projection-sql-Cl1qIn8m.cjs → projection-sql-iHy-Cx6V.cjs} +45 -1
- package/{sdk-CM1UO-I7.cjs → sdk-BL9BCzyD.cjs} +354 -20
- package/{sdk-DYBDR939.mjs → sdk-CubnsyD9.mjs} +354 -20
- package/sdk.cjs +2 -2
- package/sdk.d.cts +2 -2
- package/sdk.d.mts +2 -2
- package/sdk.mjs +2 -2
- package/{sync-engine-C4A5jgA4.cjs → sync-engine-BLgwLpR6.cjs} +1 -1
- package/{sync-engine-Dt5QQSKO.mjs → sync-engine-B_IzoUSx.mjs} +1 -1
- package/{view-compiler-B5nDal14.cjs → view-compiler-BHI5E4QI.cjs} +2 -2
- package/{view-compiler-CSYwEWf5.mjs → view-compiler-D_6gfXFr.mjs} +2 -2
- package/vite.d.cts +1 -1
- package/vite.d.mts +1 -1
- package/internal-CykXpEGk.mjs +0 -68
- package/internal-DqduZU3l.cjs +0 -97
package/internal-DqduZU3l.cjs
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
const require_projection = require("./projection-Dz6_i1-w.cjs");
|
|
2
|
-
const require_entity_config = require("./entity-config-7sGCk_nw.cjs");
|
|
3
|
-
//#region ../core/src/projection-draft.ts
|
|
4
|
-
function emptyProjectionDraft(baseTable) {
|
|
5
|
-
return {
|
|
6
|
-
baseTable,
|
|
7
|
-
entityKey: "",
|
|
8
|
-
fieldBindings: {},
|
|
9
|
-
identity: { kind: "base_pk" },
|
|
10
|
-
joins: []
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* The ON conditions implied by a foreign key between the two tables, so the
|
|
15
|
-
* builder can pre-fill a join instead of making the user hand-pick columns.
|
|
16
|
-
* Returns [] when no FK relates them — the user then picks manually.
|
|
17
|
-
*/
|
|
18
|
-
function suggestJoinConditions(baseTable, joinTable, schema, joinKey) {
|
|
19
|
-
const join = schema.find((t) => t.name === joinTable);
|
|
20
|
-
const conditions = [];
|
|
21
|
-
for (const column of join?.columnsMeta ?? []) if (column.references?.table === baseTable) conditions.push({
|
|
22
|
-
left: {
|
|
23
|
-
table: joinKey,
|
|
24
|
-
column: column.name
|
|
25
|
-
},
|
|
26
|
-
op: "eq",
|
|
27
|
-
right: {
|
|
28
|
-
table: require_projection.BASE_REF,
|
|
29
|
-
column: column.references.column
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
return conditions;
|
|
33
|
-
}
|
|
34
|
-
/** A draft becomes a projection once it has a valid key and ≥1 binding. */
|
|
35
|
-
function draftToProjection(draft) {
|
|
36
|
-
if (!require_projection.PROJECTION_KEY_PATTERN.test(draft.entityKey)) return null;
|
|
37
|
-
if (Object.keys(draft.fieldBindings).length === 0) return null;
|
|
38
|
-
return {
|
|
39
|
-
version: 1,
|
|
40
|
-
kind: "projection",
|
|
41
|
-
entityKey: draft.entityKey,
|
|
42
|
-
baseTable: draft.baseTable,
|
|
43
|
-
joins: draft.joins,
|
|
44
|
-
fieldBindings: draft.fieldBindings,
|
|
45
|
-
identity: draft.identity
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function draftErrors(draft, schema) {
|
|
49
|
-
const projection = draftToProjection(draft);
|
|
50
|
-
if (!projection) return [{
|
|
51
|
-
path: "projection",
|
|
52
|
-
message: "Name the object and map a field."
|
|
53
|
-
}];
|
|
54
|
-
return require_entity_config.validateProjection(projection, schema, "projection");
|
|
55
|
-
}
|
|
56
|
-
/** Per-join fan-out, for the builder's inline cardinality hints. */
|
|
57
|
-
function describeCardinality(draft, schema) {
|
|
58
|
-
const projection = draftToProjection(draft);
|
|
59
|
-
if (!projection) return [];
|
|
60
|
-
const tablesByName = new Map(schema.map((t) => [t.name, t]));
|
|
61
|
-
const fanning = new Set(require_entity_config.fanOutJoins(projection, tablesByName).map((j) => j.key));
|
|
62
|
-
return projection.joins.map((join) => ({
|
|
63
|
-
joinKey: join.key,
|
|
64
|
-
fansOut: fanning.has(join.key)
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
//#endregion
|
|
68
|
-
Object.defineProperty(exports, "describeCardinality", {
|
|
69
|
-
enumerable: true,
|
|
70
|
-
get: function() {
|
|
71
|
-
return describeCardinality;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(exports, "draftErrors", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: function() {
|
|
77
|
-
return draftErrors;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
Object.defineProperty(exports, "draftToProjection", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
get: function() {
|
|
83
|
-
return draftToProjection;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
Object.defineProperty(exports, "emptyProjectionDraft", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
get: function() {
|
|
89
|
-
return emptyProjectionDraft;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(exports, "suggestJoinConditions", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function() {
|
|
95
|
-
return suggestJoinConditions;
|
|
96
|
-
}
|
|
97
|
-
});
|