@milaboratories/pf-driver 1.7.12 → 1.7.14
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/_virtual/{_@oxc-project_runtime@0.123.0/helpers → _@oxc-project_runtime@0.137.0/helpers/esm}/usingCtx.cjs +2 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.123.0/helpers → _@oxc-project_runtime@0.137.0/helpers/esm}/usingCtx.js +2 -2
- package/dist/csv_writer.cjs +2 -1
- package/dist/csv_writer.cjs.map +1 -1
- package/dist/csv_writer.js +1 -1
- package/dist/csv_writer.js.map +1 -1
- package/dist/data_info_helpers.cjs +0 -1
- package/dist/data_info_helpers.cjs.map +1 -1
- package/dist/data_info_helpers.js.map +1 -1
- package/dist/driver_double.cjs +5 -2
- package/dist/driver_double.cjs.map +1 -1
- package/dist/driver_double.d.ts.map +1 -1
- package/dist/driver_double.js +3 -0
- package/dist/driver_double.js.map +1 -1
- package/dist/driver_impl.cjs +10 -10
- package/dist/driver_impl.cjs.map +1 -1
- package/dist/driver_impl.d.ts.map +1 -1
- package/dist/driver_impl.js +1 -1
- package/dist/driver_impl.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/logging.cjs.map +1 -1
- package/dist/logging.js.map +1 -1
- package/dist/pframe_pool.cjs +8 -1
- package/dist/pframe_pool.cjs.map +1 -1
- package/dist/pframe_pool.js +8 -1
- package/dist/pframe_pool.js.map +1 -1
- package/dist/ptable_cache_per_frame.cjs +2 -1
- package/dist/ptable_cache_per_frame.cjs.map +1 -1
- package/dist/ptable_cache_per_frame.d.ts.map +1 -1
- package/dist/ptable_cache_per_frame.js +2 -0
- package/dist/ptable_cache_per_frame.js.map +1 -1
- package/dist/ptable_cache_plain.cjs +1 -1
- package/dist/ptable_cache_plain.cjs.map +1 -1
- package/dist/ptable_cache_plain.d.ts.map +1 -1
- package/dist/ptable_cache_plain.js +1 -0
- package/dist/ptable_cache_plain.js.map +1 -1
- package/dist/ptable_def_pool.cjs +5 -1
- package/dist/ptable_def_pool.cjs.map +1 -1
- package/dist/ptable_def_pool.js +5 -1
- package/dist/ptable_def_pool.js.map +1 -1
- package/dist/ptable_pool.cjs +7 -1
- package/dist/ptable_pool.cjs.map +1 -1
- package/dist/ptable_pool.js +7 -1
- package/dist/ptable_pool.js.map +1 -1
- package/dist/ptable_shared.cjs +1 -1
- package/dist/ptable_shared.cjs.map +1 -1
- package/dist/ptable_shared.js +1 -1
- package/dist/ptable_shared.js.map +1 -1
- package/package.json +7 -7
package/dist/ptable_def_pool.cjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
require("./_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_logging = require("./logging.cjs");
|
|
3
2
|
const require_ptable_shared = require("./ptable_shared.cjs");
|
|
4
3
|
let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
|
|
5
4
|
let _milaboratories_helpers = require("@milaboratories/helpers");
|
|
6
5
|
//#region src/ptable_def_pool.ts
|
|
7
6
|
var PTableDefHolder = class {
|
|
7
|
+
def;
|
|
8
|
+
pTableHandle;
|
|
9
|
+
logger;
|
|
8
10
|
abortController = new AbortController();
|
|
9
11
|
constructor(def, pTableHandle, logger) {
|
|
10
12
|
this.def = def;
|
|
@@ -21,6 +23,7 @@ var PTableDefHolder = class {
|
|
|
21
23
|
}
|
|
22
24
|
};
|
|
23
25
|
var PTableDefPool = class extends _milaboratories_helpers.RefCountPoolBase {
|
|
26
|
+
logger;
|
|
24
27
|
constructor(logger) {
|
|
25
28
|
super();
|
|
26
29
|
this.logger = logger;
|
|
@@ -57,6 +60,7 @@ var PTableDefPool = class extends _milaboratories_helpers.RefCountPoolBase {
|
|
|
57
60
|
}
|
|
58
61
|
};
|
|
59
62
|
//#endregion
|
|
63
|
+
exports.PTableDefHolder = PTableDefHolder;
|
|
60
64
|
exports.PTableDefPool = PTableDefPool;
|
|
61
65
|
|
|
62
66
|
//# sourceMappingURL=ptable_def_pool.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ptable_def_pool.cjs","names":["logPFrames","RefCountPoolBase","stableKeyFromFullPTableDef","PFrameDriverError","buildFullPTableDefFromLegacy"],"sources":["../src/ptable_def_pool.ts"],"sourcesContent":["import {\n PFrameDriverError,\n type PFrameHandle,\n type PObjectId,\n type PTableDef,\n type PTableHandle,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/helpers\";\nimport { logPFrames } from \"./logging\";\nimport type { FullPTableDef } from \"./ptable_shared\";\nimport { buildFullPTableDefFromLegacy, stableKeyFromFullPTableDef } from \"./ptable_shared\";\n\nexport class PTableDefHolder implements Disposable {\n private readonly abortController = new AbortController();\n\n constructor(\n public readonly def: FullPTableDef,\n private readonly pTableHandle: PTableHandle,\n private readonly logger: PFrameInternal.Logger,\n ) {\n if (logPFrames()) {\n this.logger(\"info\", `PTable definition saved (pTableHandle = ${this.pTableHandle})`);\n }\n }\n\n public get disposeSignal(): AbortSignal {\n return this.abortController.signal;\n }\n\n [Symbol.dispose](): void {\n this.abortController.abort();\n if (logPFrames()) {\n this.logger(\"info\", `PTable definition disposed (pTableHandle = ${this.pTableHandle})`);\n }\n }\n}\n\nexport class PTableDefPool extends RefCountPoolBase<FullPTableDef, PTableHandle, PTableDefHolder> {\n constructor(private readonly logger: PFrameInternal.Logger) {\n super();\n }\n\n protected calculateParamsKey(params: FullPTableDef): PTableHandle {\n return stableKeyFromFullPTableDef(params);\n }\n\n protected createNewResource(params: FullPTableDef, key: PTableHandle): PTableDefHolder {\n return new PTableDefHolder(params, key, this.logger);\n }\n\n public getByKey(key: PTableHandle): PTableDefHolder {\n const resource = super.tryGetByKey(key);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid PTable handle`);\n error.cause = new Error(`PTable definition for handle ${key} not found`);\n throw error;\n }\n return resource;\n }\n\n /**\n * Acquire a def from a legacy `PTableDef` + column specs map.\n * Lowers the input via WASM-spec and stores the resulting\n * `{ tableSpec, dataQuery }` shape. Returns the lowered def\n * alongside the pool entry — callers that need `tableSpec`\n * (e.g. `calculateTableData`) read it from `def.tableSpec`\n * without re-deriving.\n */\n public acquireFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n }): { def: FullPTableDef; entry: PoolEntry<PTableHandle> } {\n const def = buildFullPTableDefFromLegacy(opts);\n return { def, entry: this.acquire(def) };\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ptable_def_pool.cjs","names":["logPFrames","RefCountPoolBase","stableKeyFromFullPTableDef","PFrameDriverError","buildFullPTableDefFromLegacy"],"sources":["../src/ptable_def_pool.ts"],"sourcesContent":["import {\n PFrameDriverError,\n type PFrameHandle,\n type PObjectId,\n type PTableDef,\n type PTableHandle,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/helpers\";\nimport { logPFrames } from \"./logging\";\nimport type { FullPTableDef } from \"./ptable_shared\";\nimport { buildFullPTableDefFromLegacy, stableKeyFromFullPTableDef } from \"./ptable_shared\";\n\nexport class PTableDefHolder implements Disposable {\n private readonly abortController = new AbortController();\n\n constructor(\n public readonly def: FullPTableDef,\n private readonly pTableHandle: PTableHandle,\n private readonly logger: PFrameInternal.Logger,\n ) {\n if (logPFrames()) {\n this.logger(\"info\", `PTable definition saved (pTableHandle = ${this.pTableHandle})`);\n }\n }\n\n public get disposeSignal(): AbortSignal {\n return this.abortController.signal;\n }\n\n [Symbol.dispose](): void {\n this.abortController.abort();\n if (logPFrames()) {\n this.logger(\"info\", `PTable definition disposed (pTableHandle = ${this.pTableHandle})`);\n }\n }\n}\n\nexport class PTableDefPool extends RefCountPoolBase<FullPTableDef, PTableHandle, PTableDefHolder> {\n constructor(private readonly logger: PFrameInternal.Logger) {\n super();\n }\n\n protected calculateParamsKey(params: FullPTableDef): PTableHandle {\n return stableKeyFromFullPTableDef(params);\n }\n\n protected createNewResource(params: FullPTableDef, key: PTableHandle): PTableDefHolder {\n return new PTableDefHolder(params, key, this.logger);\n }\n\n public getByKey(key: PTableHandle): PTableDefHolder {\n const resource = super.tryGetByKey(key);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid PTable handle`);\n error.cause = new Error(`PTable definition for handle ${key} not found`);\n throw error;\n }\n return resource;\n }\n\n /**\n * Acquire a def from a legacy `PTableDef` + column specs map.\n * Lowers the input via WASM-spec and stores the resulting\n * `{ tableSpec, dataQuery }` shape. Returns the lowered def\n * alongside the pool entry — callers that need `tableSpec`\n * (e.g. `calculateTableData`) read it from `def.tableSpec`\n * without re-deriving.\n */\n public acquireFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n }): { def: FullPTableDef; entry: PoolEntry<PTableHandle> } {\n const def = buildFullPTableDefFromLegacy(opts);\n return { def, entry: this.acquire(def) };\n }\n}\n"],"mappings":";;;;;AAaA,IAAa,kBAAb,MAAmD;CAI/B;CACC;CACA;CALnB,kBAAmC,IAAI,gBAAgB;CAEvD,YACE,KACA,cACA,QACA;EAHgB,KAAA,MAAA;EACC,KAAA,eAAA;EACA,KAAA,SAAA;EAEjB,IAAIA,gBAAAA,WAAW,GACb,KAAK,OAAO,QAAQ,2CAA2C,KAAK,aAAa,EAAE;CAEvF;CAEA,IAAW,gBAA6B;EACtC,OAAO,KAAK,gBAAgB;CAC9B;CAEA,CAAC,OAAO,WAAiB;EACvB,KAAK,gBAAgB,MAAM;EAC3B,IAAIA,gBAAAA,WAAW,GACb,KAAK,OAAO,QAAQ,8CAA8C,KAAK,aAAa,EAAE;CAE1F;AACF;AAEA,IAAa,gBAAb,cAAmCC,wBAAAA,iBAA+D;CACnE;CAA7B,YAAY,QAAgD;EAC1D,MAAM;EADqB,KAAA,SAAA;CAE7B;CAEA,mBAA6B,QAAqC;EAChE,OAAOC,sBAAAA,2BAA2B,MAAM;CAC1C;CAEA,kBAA4B,QAAuB,KAAoC;EACrF,OAAO,IAAI,gBAAgB,QAAQ,KAAK,KAAK,MAAM;CACrD;CAEA,SAAgB,KAAoC;EAClD,MAAM,WAAW,MAAM,YAAY,GAAG;EACtC,IAAI,CAAC,UAAU;GACb,MAAM,QAAQ,IAAIC,gCAAAA,kBAAkB,uBAAuB;GAC3D,MAAM,wBAAQ,IAAI,MAAM,gCAAgC,IAAI,WAAW;GACvE,MAAM;EACR;EACA,OAAO;CACT;;;;;;;;;CAUA,kBAAyB,MAIkC;EACzD,MAAM,MAAMC,sBAAAA,6BAA6B,IAAI;EAC7C,OAAO;GAAE;GAAK,OAAO,KAAK,QAAQ,GAAG;EAAE;CACzC;AACF"}
|
package/dist/ptable_def_pool.js
CHANGED
|
@@ -4,6 +4,9 @@ import { PFrameDriverError } from "@milaboratories/pl-model-common";
|
|
|
4
4
|
import { RefCountPoolBase } from "@milaboratories/helpers";
|
|
5
5
|
//#region src/ptable_def_pool.ts
|
|
6
6
|
var PTableDefHolder = class {
|
|
7
|
+
def;
|
|
8
|
+
pTableHandle;
|
|
9
|
+
logger;
|
|
7
10
|
abortController = new AbortController();
|
|
8
11
|
constructor(def, pTableHandle, logger) {
|
|
9
12
|
this.def = def;
|
|
@@ -20,6 +23,7 @@ var PTableDefHolder = class {
|
|
|
20
23
|
}
|
|
21
24
|
};
|
|
22
25
|
var PTableDefPool = class extends RefCountPoolBase {
|
|
26
|
+
logger;
|
|
23
27
|
constructor(logger) {
|
|
24
28
|
super();
|
|
25
29
|
this.logger = logger;
|
|
@@ -56,6 +60,6 @@ var PTableDefPool = class extends RefCountPoolBase {
|
|
|
56
60
|
}
|
|
57
61
|
};
|
|
58
62
|
//#endregion
|
|
59
|
-
export { PTableDefPool };
|
|
63
|
+
export { PTableDefHolder, PTableDefPool };
|
|
60
64
|
|
|
61
65
|
//# sourceMappingURL=ptable_def_pool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ptable_def_pool.js","names":[],"sources":["../src/ptable_def_pool.ts"],"sourcesContent":["import {\n PFrameDriverError,\n type PFrameHandle,\n type PObjectId,\n type PTableDef,\n type PTableHandle,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/helpers\";\nimport { logPFrames } from \"./logging\";\nimport type { FullPTableDef } from \"./ptable_shared\";\nimport { buildFullPTableDefFromLegacy, stableKeyFromFullPTableDef } from \"./ptable_shared\";\n\nexport class PTableDefHolder implements Disposable {\n private readonly abortController = new AbortController();\n\n constructor(\n public readonly def: FullPTableDef,\n private readonly pTableHandle: PTableHandle,\n private readonly logger: PFrameInternal.Logger,\n ) {\n if (logPFrames()) {\n this.logger(\"info\", `PTable definition saved (pTableHandle = ${this.pTableHandle})`);\n }\n }\n\n public get disposeSignal(): AbortSignal {\n return this.abortController.signal;\n }\n\n [Symbol.dispose](): void {\n this.abortController.abort();\n if (logPFrames()) {\n this.logger(\"info\", `PTable definition disposed (pTableHandle = ${this.pTableHandle})`);\n }\n }\n}\n\nexport class PTableDefPool extends RefCountPoolBase<FullPTableDef, PTableHandle, PTableDefHolder> {\n constructor(private readonly logger: PFrameInternal.Logger) {\n super();\n }\n\n protected calculateParamsKey(params: FullPTableDef): PTableHandle {\n return stableKeyFromFullPTableDef(params);\n }\n\n protected createNewResource(params: FullPTableDef, key: PTableHandle): PTableDefHolder {\n return new PTableDefHolder(params, key, this.logger);\n }\n\n public getByKey(key: PTableHandle): PTableDefHolder {\n const resource = super.tryGetByKey(key);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid PTable handle`);\n error.cause = new Error(`PTable definition for handle ${key} not found`);\n throw error;\n }\n return resource;\n }\n\n /**\n * Acquire a def from a legacy `PTableDef` + column specs map.\n * Lowers the input via WASM-spec and stores the resulting\n * `{ tableSpec, dataQuery }` shape. Returns the lowered def\n * alongside the pool entry — callers that need `tableSpec`\n * (e.g. `calculateTableData`) read it from `def.tableSpec`\n * without re-deriving.\n */\n public acquireFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n }): { def: FullPTableDef; entry: PoolEntry<PTableHandle> } {\n const def = buildFullPTableDefFromLegacy(opts);\n return { def, entry: this.acquire(def) };\n }\n}\n"],"mappings":";;;;;AAaA,IAAa,kBAAb,MAAmD;
|
|
1
|
+
{"version":3,"file":"ptable_def_pool.js","names":[],"sources":["../src/ptable_def_pool.ts"],"sourcesContent":["import {\n PFrameDriverError,\n type PFrameHandle,\n type PObjectId,\n type PTableDef,\n type PTableHandle,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/helpers\";\nimport { logPFrames } from \"./logging\";\nimport type { FullPTableDef } from \"./ptable_shared\";\nimport { buildFullPTableDefFromLegacy, stableKeyFromFullPTableDef } from \"./ptable_shared\";\n\nexport class PTableDefHolder implements Disposable {\n private readonly abortController = new AbortController();\n\n constructor(\n public readonly def: FullPTableDef,\n private readonly pTableHandle: PTableHandle,\n private readonly logger: PFrameInternal.Logger,\n ) {\n if (logPFrames()) {\n this.logger(\"info\", `PTable definition saved (pTableHandle = ${this.pTableHandle})`);\n }\n }\n\n public get disposeSignal(): AbortSignal {\n return this.abortController.signal;\n }\n\n [Symbol.dispose](): void {\n this.abortController.abort();\n if (logPFrames()) {\n this.logger(\"info\", `PTable definition disposed (pTableHandle = ${this.pTableHandle})`);\n }\n }\n}\n\nexport class PTableDefPool extends RefCountPoolBase<FullPTableDef, PTableHandle, PTableDefHolder> {\n constructor(private readonly logger: PFrameInternal.Logger) {\n super();\n }\n\n protected calculateParamsKey(params: FullPTableDef): PTableHandle {\n return stableKeyFromFullPTableDef(params);\n }\n\n protected createNewResource(params: FullPTableDef, key: PTableHandle): PTableDefHolder {\n return new PTableDefHolder(params, key, this.logger);\n }\n\n public getByKey(key: PTableHandle): PTableDefHolder {\n const resource = super.tryGetByKey(key);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid PTable handle`);\n error.cause = new Error(`PTable definition for handle ${key} not found`);\n throw error;\n }\n return resource;\n }\n\n /**\n * Acquire a def from a legacy `PTableDef` + column specs map.\n * Lowers the input via WASM-spec and stores the resulting\n * `{ tableSpec, dataQuery }` shape. Returns the lowered def\n * alongside the pool entry — callers that need `tableSpec`\n * (e.g. `calculateTableData`) read it from `def.tableSpec`\n * without re-deriving.\n */\n public acquireFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n }): { def: FullPTableDef; entry: PoolEntry<PTableHandle> } {\n const def = buildFullPTableDefFromLegacy(opts);\n return { def, entry: this.acquire(def) };\n }\n}\n"],"mappings":";;;;;AAaA,IAAa,kBAAb,MAAmD;CAI/B;CACC;CACA;CALnB,kBAAmC,IAAI,gBAAgB;CAEvD,YACE,KACA,cACA,QACA;EAHgB,KAAA,MAAA;EACC,KAAA,eAAA;EACA,KAAA,SAAA;EAEjB,IAAI,WAAW,GACb,KAAK,OAAO,QAAQ,2CAA2C,KAAK,aAAa,EAAE;CAEvF;CAEA,IAAW,gBAA6B;EACtC,OAAO,KAAK,gBAAgB;CAC9B;CAEA,CAAC,OAAO,WAAiB;EACvB,KAAK,gBAAgB,MAAM;EAC3B,IAAI,WAAW,GACb,KAAK,OAAO,QAAQ,8CAA8C,KAAK,aAAa,EAAE;CAE1F;AACF;AAEA,IAAa,gBAAb,cAAmC,iBAA+D;CACnE;CAA7B,YAAY,QAAgD;EAC1D,MAAM;EADqB,KAAA,SAAA;CAE7B;CAEA,mBAA6B,QAAqC;EAChE,OAAO,2BAA2B,MAAM;CAC1C;CAEA,kBAA4B,QAAuB,KAAoC;EACrF,OAAO,IAAI,gBAAgB,QAAQ,KAAK,KAAK,MAAM;CACrD;CAEA,SAAgB,KAAoC;EAClD,MAAM,WAAW,MAAM,YAAY,GAAG;EACtC,IAAI,CAAC,UAAU;GACb,MAAM,QAAQ,IAAI,kBAAkB,uBAAuB;GAC3D,MAAM,wBAAQ,IAAI,MAAM,gCAAgC,IAAI,WAAW;GACvE,MAAM;EACR;EACA,OAAO;CACT;;;;;;;;;CAUA,kBAAyB,MAIkC;EACzD,MAAM,MAAM,6BAA6B,IAAI;EAC7C,OAAO;GAAE;GAAK,OAAO,KAAK,QAAQ,GAAG;EAAE;CACzC;AACF"}
|
package/dist/ptable_pool.cjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
require("./_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_logging = require("./logging.cjs");
|
|
3
2
|
const require_ptable_shared = require("./ptable_shared.cjs");
|
|
4
3
|
let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
|
|
5
4
|
let _milaboratories_helpers = require("@milaboratories/helpers");
|
|
6
5
|
//#region src/ptable_pool.ts
|
|
7
6
|
var PTableHolder = class {
|
|
7
|
+
pFrame;
|
|
8
|
+
pTablePromise;
|
|
9
|
+
predecessor;
|
|
8
10
|
abortController = new AbortController();
|
|
9
11
|
combinedDisposeSignal;
|
|
10
12
|
cacheSizePromise;
|
|
@@ -31,6 +33,9 @@ var PTableHolder = class {
|
|
|
31
33
|
}
|
|
32
34
|
};
|
|
33
35
|
var PTablePool = class extends _milaboratories_helpers.RefCountPoolBase {
|
|
36
|
+
pFrames;
|
|
37
|
+
pTableDefs;
|
|
38
|
+
logger;
|
|
34
39
|
constructor(pFrames, pTableDefs, logger) {
|
|
35
40
|
super();
|
|
36
41
|
this.pFrames = pFrames;
|
|
@@ -73,6 +78,7 @@ var PTablePool = class extends _milaboratories_helpers.RefCountPoolBase {
|
|
|
73
78
|
}
|
|
74
79
|
};
|
|
75
80
|
//#endregion
|
|
81
|
+
exports.PTableHolder = PTableHolder;
|
|
76
82
|
exports.PTablePool = PTablePool;
|
|
77
83
|
|
|
78
84
|
//# sourceMappingURL=ptable_pool.cjs.map
|
package/dist/ptable_pool.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ptable_pool.cjs","names":["RefCountPoolBase","stableKeyFromFullPTableDef","logPFrames","bigintReplacer","PFrameDriverError","buildFullPTableDefFromLegacy"],"sources":["../src/ptable_pool.ts"],"sourcesContent":["import {\n bigintReplacer,\n PFrameDriverError,\n type PFrameHandle,\n type PTableDef,\n type PTableHandle,\n type JsonSerializable,\n type PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/helpers\";\nimport { logPFrames } from \"./logging\";\nimport type { PFramePool } from \"./pframe_pool\";\nimport {\n buildFullPTableDefFromLegacy,\n stableKeyFromFullPTableDef,\n type FullPTableDef,\n} from \"./ptable_shared\";\nimport type { PTableDefPool } from \"./ptable_def_pool\";\n\nexport class PTableHolder implements Disposable {\n private readonly abortController = new AbortController();\n private readonly combinedDisposeSignal: AbortSignal;\n private cacheSizePromise?: Promise<number>;\n\n constructor(\n public readonly pFrame: PFrameHandle,\n pFrameDisposeSignal: AbortSignal,\n public readonly pTablePromise: Promise<PFrameInternal.PTableV12>,\n private readonly predecessor?: PoolEntry<PTableHandle, PTableHolder>,\n ) {\n this.combinedDisposeSignal = AbortSignal.any([\n pFrameDisposeSignal,\n this.abortController.signal,\n ]);\n }\n\n public get disposeSignal(): AbortSignal {\n return this.combinedDisposeSignal;\n }\n\n public get cacheSize(): Promise<number> {\n if (this.cacheSizePromise === undefined) {\n this.cacheSizePromise = this.pTablePromise.then((pTable) =>\n pTable.getFootprint({\n withPredecessors: false,\n signal: this.abortController.signal,\n }),\n );\n }\n return this.cacheSizePromise;\n }\n\n [Symbol.dispose](): void {\n this.abortController.abort();\n this.predecessor?.unref();\n void this.pTablePromise\n .then((pTable) => pTable.dispose())\n .catch(() => {\n /* mute error */\n });\n }\n}\n\nexport class PTablePool<TreeEntry extends JsonSerializable> extends RefCountPoolBase<\n FullPTableDef,\n PTableHandle,\n PTableHolder\n> {\n constructor(\n private readonly pFrames: PFramePool<TreeEntry>,\n private readonly pTableDefs: PTableDefPool,\n private readonly logger: PFrameInternal.Logger,\n ) {\n super();\n }\n\n protected calculateParamsKey(params: FullPTableDef): PTableHandle {\n return stableKeyFromFullPTableDef(params);\n }\n\n protected createNewResource(params: FullPTableDef, key: PTableHandle): PTableHolder {\n if (logPFrames()) {\n this.logger(\n \"info\",\n `PTable creation (pTableHandle = ${key}): ` + `${JSON.stringify(params, bigintReplacer)}`,\n );\n }\n\n const { pFrameHandle } = params;\n const { pFrameDataPromise: pFramePromise, disposeSignal } = this.pFrames.getByKey(pFrameHandle);\n\n const defDisposeSignal = this.pTableDefs.tryGetByKey(key)?.disposeSignal;\n const combinedSignal = AbortSignal.any([disposeSignal, defDisposeSignal].filter((s) => !!s));\n\n const { dataQuery } = params;\n const table = pFramePromise.then((pFrame) => pFrame.createTable(key, dataQuery));\n return new PTableHolder(pFrameHandle, combinedSignal, table);\n }\n\n public getByKey(key: PTableHandle): PTableHolder {\n const resource = super.tryGetByKey(key);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid PTable handle`);\n error.cause = new Error(`PTable with handle ${key} not found`);\n throw error;\n }\n return resource;\n }\n\n /**\n * Acquire a PTable from a legacy `PTableDef` + column specs map.\n * Lowers the input via WASM-spec and stores the resulting\n * `{ tableSpec, dataQuery }` shape. Returns the lowered def\n * alongside the pool entry.\n */\n public acquireFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n }): { def: FullPTableDef; entry: PoolEntry<PTableHandle, PTableHolder> } {\n const def = buildFullPTableDefFromLegacy(opts);\n return { def, entry: this.acquire(def) };\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ptable_pool.cjs","names":["RefCountPoolBase","stableKeyFromFullPTableDef","logPFrames","bigintReplacer","PFrameDriverError","buildFullPTableDefFromLegacy"],"sources":["../src/ptable_pool.ts"],"sourcesContent":["import {\n bigintReplacer,\n PFrameDriverError,\n type PFrameHandle,\n type PTableDef,\n type PTableHandle,\n type JsonSerializable,\n type PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/helpers\";\nimport { logPFrames } from \"./logging\";\nimport type { PFramePool } from \"./pframe_pool\";\nimport {\n buildFullPTableDefFromLegacy,\n stableKeyFromFullPTableDef,\n type FullPTableDef,\n} from \"./ptable_shared\";\nimport type { PTableDefPool } from \"./ptable_def_pool\";\n\nexport class PTableHolder implements Disposable {\n private readonly abortController = new AbortController();\n private readonly combinedDisposeSignal: AbortSignal;\n private cacheSizePromise?: Promise<number>;\n\n constructor(\n public readonly pFrame: PFrameHandle,\n pFrameDisposeSignal: AbortSignal,\n public readonly pTablePromise: Promise<PFrameInternal.PTableV12>,\n private readonly predecessor?: PoolEntry<PTableHandle, PTableHolder>,\n ) {\n this.combinedDisposeSignal = AbortSignal.any([\n pFrameDisposeSignal,\n this.abortController.signal,\n ]);\n }\n\n public get disposeSignal(): AbortSignal {\n return this.combinedDisposeSignal;\n }\n\n public get cacheSize(): Promise<number> {\n if (this.cacheSizePromise === undefined) {\n this.cacheSizePromise = this.pTablePromise.then((pTable) =>\n pTable.getFootprint({\n withPredecessors: false,\n signal: this.abortController.signal,\n }),\n );\n }\n return this.cacheSizePromise;\n }\n\n [Symbol.dispose](): void {\n this.abortController.abort();\n this.predecessor?.unref();\n void this.pTablePromise\n .then((pTable) => pTable.dispose())\n .catch(() => {\n /* mute error */\n });\n }\n}\n\nexport class PTablePool<TreeEntry extends JsonSerializable> extends RefCountPoolBase<\n FullPTableDef,\n PTableHandle,\n PTableHolder\n> {\n constructor(\n private readonly pFrames: PFramePool<TreeEntry>,\n private readonly pTableDefs: PTableDefPool,\n private readonly logger: PFrameInternal.Logger,\n ) {\n super();\n }\n\n protected calculateParamsKey(params: FullPTableDef): PTableHandle {\n return stableKeyFromFullPTableDef(params);\n }\n\n protected createNewResource(params: FullPTableDef, key: PTableHandle): PTableHolder {\n if (logPFrames()) {\n this.logger(\n \"info\",\n `PTable creation (pTableHandle = ${key}): ` + `${JSON.stringify(params, bigintReplacer)}`,\n );\n }\n\n const { pFrameHandle } = params;\n const { pFrameDataPromise: pFramePromise, disposeSignal } = this.pFrames.getByKey(pFrameHandle);\n\n const defDisposeSignal = this.pTableDefs.tryGetByKey(key)?.disposeSignal;\n const combinedSignal = AbortSignal.any([disposeSignal, defDisposeSignal].filter((s) => !!s));\n\n const { dataQuery } = params;\n const table = pFramePromise.then((pFrame) => pFrame.createTable(key, dataQuery));\n return new PTableHolder(pFrameHandle, combinedSignal, table);\n }\n\n public getByKey(key: PTableHandle): PTableHolder {\n const resource = super.tryGetByKey(key);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid PTable handle`);\n error.cause = new Error(`PTable with handle ${key} not found`);\n throw error;\n }\n return resource;\n }\n\n /**\n * Acquire a PTable from a legacy `PTableDef` + column specs map.\n * Lowers the input via WASM-spec and stores the resulting\n * `{ tableSpec, dataQuery }` shape. Returns the lowered def\n * alongside the pool entry.\n */\n public acquireFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n }): { def: FullPTableDef; entry: PoolEntry<PTableHandle, PTableHolder> } {\n const def = buildFullPTableDefFromLegacy(opts);\n return { def, entry: this.acquire(def) };\n }\n}\n"],"mappings":";;;;;AAoBA,IAAa,eAAb,MAAgD;CAM5B;CAEA;CACC;CARnB,kBAAmC,IAAI,gBAAgB;CACvD;CACA;CAEA,YACE,QACA,qBACA,eACA,aACA;EAJgB,KAAA,SAAA;EAEA,KAAA,gBAAA;EACC,KAAA,cAAA;EAEjB,KAAK,wBAAwB,YAAY,IAAI,CAC3C,qBACA,KAAK,gBAAgB,MACvB,CAAC;CACH;CAEA,IAAW,gBAA6B;EACtC,OAAO,KAAK;CACd;CAEA,IAAW,YAA6B;EACtC,IAAI,KAAK,qBAAqB,KAAA,GAC5B,KAAK,mBAAmB,KAAK,cAAc,MAAM,WAC/C,OAAO,aAAa;GAClB,kBAAkB;GAClB,QAAQ,KAAK,gBAAgB;EAC/B,CAAC,CACH;EAEF,OAAO,KAAK;CACd;CAEA,CAAC,OAAO,WAAiB;EACvB,KAAK,gBAAgB,MAAM;EAC3B,KAAK,aAAa,MAAM;EACxB,KAAU,cACP,MAAM,WAAW,OAAO,QAAQ,CAAC,CAAC,CAClC,YAAY,CAEb,CAAC;CACL;AACF;AAEA,IAAa,aAAb,cAAoEA,wBAAAA,iBAIlE;CAEmB;CACA;CACA;CAHnB,YACE,SACA,YACA,QACA;EACA,MAAM;EAJW,KAAA,UAAA;EACA,KAAA,aAAA;EACA,KAAA,SAAA;CAGnB;CAEA,mBAA6B,QAAqC;EAChE,OAAOC,sBAAAA,2BAA2B,MAAM;CAC1C;CAEA,kBAA4B,QAAuB,KAAiC;EAClF,IAAIC,gBAAAA,WAAW,GACb,KAAK,OACH,QACA,mCAAmC,IAAI,KAAU,KAAK,UAAU,QAAQC,gCAAAA,cAAc,GACxF;EAGF,MAAM,EAAE,iBAAiB;EACzB,MAAM,EAAE,mBAAmB,eAAe,kBAAkB,KAAK,QAAQ,SAAS,YAAY;EAE9F,MAAM,mBAAmB,KAAK,WAAW,YAAY,GAAG,CAAC,EAAE;EAC3D,MAAM,iBAAiB,YAAY,IAAI,CAAC,eAAe,gBAAgB,CAAC,CAAC,QAAQ,MAAM,CAAC,CAAC,CAAC,CAAC;EAE3F,MAAM,EAAE,cAAc;EAEtB,OAAO,IAAI,aAAa,cAAc,gBADxB,cAAc,MAAM,WAAW,OAAO,YAAY,KAAK,SAAS,CACpB,CAAC;CAC7D;CAEA,SAAgB,KAAiC;EAC/C,MAAM,WAAW,MAAM,YAAY,GAAG;EACtC,IAAI,CAAC,UAAU;GACb,MAAM,QAAQ,IAAIC,gCAAAA,kBAAkB,uBAAuB;GAC3D,MAAM,wBAAQ,IAAI,MAAM,sBAAsB,IAAI,WAAW;GAC7D,MAAM;EACR;EACA,OAAO;CACT;;;;;;;CAQA,kBAAyB,MAIgD;EACvE,MAAM,MAAMC,sBAAAA,6BAA6B,IAAI;EAC7C,OAAO;GAAE;GAAK,OAAO,KAAK,QAAQ,GAAG;EAAE;CACzC;AACF"}
|
package/dist/ptable_pool.js
CHANGED
|
@@ -4,6 +4,9 @@ import { PFrameDriverError, bigintReplacer } from "@milaboratories/pl-model-comm
|
|
|
4
4
|
import { RefCountPoolBase } from "@milaboratories/helpers";
|
|
5
5
|
//#region src/ptable_pool.ts
|
|
6
6
|
var PTableHolder = class {
|
|
7
|
+
pFrame;
|
|
8
|
+
pTablePromise;
|
|
9
|
+
predecessor;
|
|
7
10
|
abortController = new AbortController();
|
|
8
11
|
combinedDisposeSignal;
|
|
9
12
|
cacheSizePromise;
|
|
@@ -30,6 +33,9 @@ var PTableHolder = class {
|
|
|
30
33
|
}
|
|
31
34
|
};
|
|
32
35
|
var PTablePool = class extends RefCountPoolBase {
|
|
36
|
+
pFrames;
|
|
37
|
+
pTableDefs;
|
|
38
|
+
logger;
|
|
33
39
|
constructor(pFrames, pTableDefs, logger) {
|
|
34
40
|
super();
|
|
35
41
|
this.pFrames = pFrames;
|
|
@@ -72,6 +78,6 @@ var PTablePool = class extends RefCountPoolBase {
|
|
|
72
78
|
}
|
|
73
79
|
};
|
|
74
80
|
//#endregion
|
|
75
|
-
export { PTablePool };
|
|
81
|
+
export { PTableHolder, PTablePool };
|
|
76
82
|
|
|
77
83
|
//# sourceMappingURL=ptable_pool.js.map
|
package/dist/ptable_pool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ptable_pool.js","names":[],"sources":["../src/ptable_pool.ts"],"sourcesContent":["import {\n bigintReplacer,\n PFrameDriverError,\n type PFrameHandle,\n type PTableDef,\n type PTableHandle,\n type JsonSerializable,\n type PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/helpers\";\nimport { logPFrames } from \"./logging\";\nimport type { PFramePool } from \"./pframe_pool\";\nimport {\n buildFullPTableDefFromLegacy,\n stableKeyFromFullPTableDef,\n type FullPTableDef,\n} from \"./ptable_shared\";\nimport type { PTableDefPool } from \"./ptable_def_pool\";\n\nexport class PTableHolder implements Disposable {\n private readonly abortController = new AbortController();\n private readonly combinedDisposeSignal: AbortSignal;\n private cacheSizePromise?: Promise<number>;\n\n constructor(\n public readonly pFrame: PFrameHandle,\n pFrameDisposeSignal: AbortSignal,\n public readonly pTablePromise: Promise<PFrameInternal.PTableV12>,\n private readonly predecessor?: PoolEntry<PTableHandle, PTableHolder>,\n ) {\n this.combinedDisposeSignal = AbortSignal.any([\n pFrameDisposeSignal,\n this.abortController.signal,\n ]);\n }\n\n public get disposeSignal(): AbortSignal {\n return this.combinedDisposeSignal;\n }\n\n public get cacheSize(): Promise<number> {\n if (this.cacheSizePromise === undefined) {\n this.cacheSizePromise = this.pTablePromise.then((pTable) =>\n pTable.getFootprint({\n withPredecessors: false,\n signal: this.abortController.signal,\n }),\n );\n }\n return this.cacheSizePromise;\n }\n\n [Symbol.dispose](): void {\n this.abortController.abort();\n this.predecessor?.unref();\n void this.pTablePromise\n .then((pTable) => pTable.dispose())\n .catch(() => {\n /* mute error */\n });\n }\n}\n\nexport class PTablePool<TreeEntry extends JsonSerializable> extends RefCountPoolBase<\n FullPTableDef,\n PTableHandle,\n PTableHolder\n> {\n constructor(\n private readonly pFrames: PFramePool<TreeEntry>,\n private readonly pTableDefs: PTableDefPool,\n private readonly logger: PFrameInternal.Logger,\n ) {\n super();\n }\n\n protected calculateParamsKey(params: FullPTableDef): PTableHandle {\n return stableKeyFromFullPTableDef(params);\n }\n\n protected createNewResource(params: FullPTableDef, key: PTableHandle): PTableHolder {\n if (logPFrames()) {\n this.logger(\n \"info\",\n `PTable creation (pTableHandle = ${key}): ` + `${JSON.stringify(params, bigintReplacer)}`,\n );\n }\n\n const { pFrameHandle } = params;\n const { pFrameDataPromise: pFramePromise, disposeSignal } = this.pFrames.getByKey(pFrameHandle);\n\n const defDisposeSignal = this.pTableDefs.tryGetByKey(key)?.disposeSignal;\n const combinedSignal = AbortSignal.any([disposeSignal, defDisposeSignal].filter((s) => !!s));\n\n const { dataQuery } = params;\n const table = pFramePromise.then((pFrame) => pFrame.createTable(key, dataQuery));\n return new PTableHolder(pFrameHandle, combinedSignal, table);\n }\n\n public getByKey(key: PTableHandle): PTableHolder {\n const resource = super.tryGetByKey(key);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid PTable handle`);\n error.cause = new Error(`PTable with handle ${key} not found`);\n throw error;\n }\n return resource;\n }\n\n /**\n * Acquire a PTable from a legacy `PTableDef` + column specs map.\n * Lowers the input via WASM-spec and stores the resulting\n * `{ tableSpec, dataQuery }` shape. Returns the lowered def\n * alongside the pool entry.\n */\n public acquireFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n }): { def: FullPTableDef; entry: PoolEntry<PTableHandle, PTableHolder> } {\n const def = buildFullPTableDefFromLegacy(opts);\n return { def, entry: this.acquire(def) };\n }\n}\n"],"mappings":";;;;;AAoBA,IAAa,eAAb,MAAgD;
|
|
1
|
+
{"version":3,"file":"ptable_pool.js","names":[],"sources":["../src/ptable_pool.ts"],"sourcesContent":["import {\n bigintReplacer,\n PFrameDriverError,\n type PFrameHandle,\n type PTableDef,\n type PTableHandle,\n type JsonSerializable,\n type PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/helpers\";\nimport { logPFrames } from \"./logging\";\nimport type { PFramePool } from \"./pframe_pool\";\nimport {\n buildFullPTableDefFromLegacy,\n stableKeyFromFullPTableDef,\n type FullPTableDef,\n} from \"./ptable_shared\";\nimport type { PTableDefPool } from \"./ptable_def_pool\";\n\nexport class PTableHolder implements Disposable {\n private readonly abortController = new AbortController();\n private readonly combinedDisposeSignal: AbortSignal;\n private cacheSizePromise?: Promise<number>;\n\n constructor(\n public readonly pFrame: PFrameHandle,\n pFrameDisposeSignal: AbortSignal,\n public readonly pTablePromise: Promise<PFrameInternal.PTableV12>,\n private readonly predecessor?: PoolEntry<PTableHandle, PTableHolder>,\n ) {\n this.combinedDisposeSignal = AbortSignal.any([\n pFrameDisposeSignal,\n this.abortController.signal,\n ]);\n }\n\n public get disposeSignal(): AbortSignal {\n return this.combinedDisposeSignal;\n }\n\n public get cacheSize(): Promise<number> {\n if (this.cacheSizePromise === undefined) {\n this.cacheSizePromise = this.pTablePromise.then((pTable) =>\n pTable.getFootprint({\n withPredecessors: false,\n signal: this.abortController.signal,\n }),\n );\n }\n return this.cacheSizePromise;\n }\n\n [Symbol.dispose](): void {\n this.abortController.abort();\n this.predecessor?.unref();\n void this.pTablePromise\n .then((pTable) => pTable.dispose())\n .catch(() => {\n /* mute error */\n });\n }\n}\n\nexport class PTablePool<TreeEntry extends JsonSerializable> extends RefCountPoolBase<\n FullPTableDef,\n PTableHandle,\n PTableHolder\n> {\n constructor(\n private readonly pFrames: PFramePool<TreeEntry>,\n private readonly pTableDefs: PTableDefPool,\n private readonly logger: PFrameInternal.Logger,\n ) {\n super();\n }\n\n protected calculateParamsKey(params: FullPTableDef): PTableHandle {\n return stableKeyFromFullPTableDef(params);\n }\n\n protected createNewResource(params: FullPTableDef, key: PTableHandle): PTableHolder {\n if (logPFrames()) {\n this.logger(\n \"info\",\n `PTable creation (pTableHandle = ${key}): ` + `${JSON.stringify(params, bigintReplacer)}`,\n );\n }\n\n const { pFrameHandle } = params;\n const { pFrameDataPromise: pFramePromise, disposeSignal } = this.pFrames.getByKey(pFrameHandle);\n\n const defDisposeSignal = this.pTableDefs.tryGetByKey(key)?.disposeSignal;\n const combinedSignal = AbortSignal.any([disposeSignal, defDisposeSignal].filter((s) => !!s));\n\n const { dataQuery } = params;\n const table = pFramePromise.then((pFrame) => pFrame.createTable(key, dataQuery));\n return new PTableHolder(pFrameHandle, combinedSignal, table);\n }\n\n public getByKey(key: PTableHandle): PTableHolder {\n const resource = super.tryGetByKey(key);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid PTable handle`);\n error.cause = new Error(`PTable with handle ${key} not found`);\n throw error;\n }\n return resource;\n }\n\n /**\n * Acquire a PTable from a legacy `PTableDef` + column specs map.\n * Lowers the input via WASM-spec and stores the resulting\n * `{ tableSpec, dataQuery }` shape. Returns the lowered def\n * alongside the pool entry.\n */\n public acquireFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n }): { def: FullPTableDef; entry: PoolEntry<PTableHandle, PTableHolder> } {\n const def = buildFullPTableDefFromLegacy(opts);\n return { def, entry: this.acquire(def) };\n }\n}\n"],"mappings":";;;;;AAoBA,IAAa,eAAb,MAAgD;CAM5B;CAEA;CACC;CARnB,kBAAmC,IAAI,gBAAgB;CACvD;CACA;CAEA,YACE,QACA,qBACA,eACA,aACA;EAJgB,KAAA,SAAA;EAEA,KAAA,gBAAA;EACC,KAAA,cAAA;EAEjB,KAAK,wBAAwB,YAAY,IAAI,CAC3C,qBACA,KAAK,gBAAgB,MACvB,CAAC;CACH;CAEA,IAAW,gBAA6B;EACtC,OAAO,KAAK;CACd;CAEA,IAAW,YAA6B;EACtC,IAAI,KAAK,qBAAqB,KAAA,GAC5B,KAAK,mBAAmB,KAAK,cAAc,MAAM,WAC/C,OAAO,aAAa;GAClB,kBAAkB;GAClB,QAAQ,KAAK,gBAAgB;EAC/B,CAAC,CACH;EAEF,OAAO,KAAK;CACd;CAEA,CAAC,OAAO,WAAiB;EACvB,KAAK,gBAAgB,MAAM;EAC3B,KAAK,aAAa,MAAM;EACxB,KAAU,cACP,MAAM,WAAW,OAAO,QAAQ,CAAC,CAAC,CAClC,YAAY,CAEb,CAAC;CACL;AACF;AAEA,IAAa,aAAb,cAAoE,iBAIlE;CAEmB;CACA;CACA;CAHnB,YACE,SACA,YACA,QACA;EACA,MAAM;EAJW,KAAA,UAAA;EACA,KAAA,aAAA;EACA,KAAA,SAAA;CAGnB;CAEA,mBAA6B,QAAqC;EAChE,OAAO,2BAA2B,MAAM;CAC1C;CAEA,kBAA4B,QAAuB,KAAiC;EAClF,IAAI,WAAW,GACb,KAAK,OACH,QACA,mCAAmC,IAAI,KAAU,KAAK,UAAU,QAAQ,cAAc,GACxF;EAGF,MAAM,EAAE,iBAAiB;EACzB,MAAM,EAAE,mBAAmB,eAAe,kBAAkB,KAAK,QAAQ,SAAS,YAAY;EAE9F,MAAM,mBAAmB,KAAK,WAAW,YAAY,GAAG,CAAC,EAAE;EAC3D,MAAM,iBAAiB,YAAY,IAAI,CAAC,eAAe,gBAAgB,CAAC,CAAC,QAAQ,MAAM,CAAC,CAAC,CAAC,CAAC;EAE3F,MAAM,EAAE,cAAc;EAEtB,OAAO,IAAI,aAAa,cAAc,gBADxB,cAAc,MAAM,WAAW,OAAO,YAAY,KAAK,SAAS,CACpB,CAAC;CAC7D;CAEA,SAAgB,KAAiC;EAC/C,MAAM,WAAW,MAAM,YAAY,GAAG;EACtC,IAAI,CAAC,UAAU;GACb,MAAM,QAAQ,IAAI,kBAAkB,uBAAuB;GAC3D,MAAM,wBAAQ,IAAI,MAAM,sBAAsB,IAAI,WAAW;GAC7D,MAAM;EACR;EACA,OAAO;CACT;;;;;;;CAQA,kBAAyB,MAIgD;EACvE,MAAM,MAAM,6BAA6B,IAAI;EAC7C,OAAO;GAAE;GAAK,OAAO,KAAK,QAAQ,GAAG;EAAE;CACzC;AACF"}
|
package/dist/ptable_shared.cjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("./_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
|
|
3
2
|
let _milaboratories_pl_model_middle_layer = require("@milaboratories/pl-model-middle-layer");
|
|
4
3
|
//#region src/ptable_shared.ts
|
|
@@ -58,6 +57,7 @@ function buildFullPTableDefFromLegacy(opts) {
|
|
|
58
57
|
//#endregion
|
|
59
58
|
exports.buildFullPTableDefFromLegacy = buildFullPTableDefFromLegacy;
|
|
60
59
|
exports.embedInlineColumnTypeSpecs = embedInlineColumnTypeSpecs;
|
|
60
|
+
exports.lowerLegacyPTableDef = lowerLegacyPTableDef;
|
|
61
61
|
exports.stableKeyFromFullPTableDef = stableKeyFromFullPTableDef;
|
|
62
62
|
|
|
63
63
|
//# sourceMappingURL=ptable_shared.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ptable_shared.cjs","names":[],"sources":["../src/ptable_shared.ts"],"sourcesContent":["import type {\n DataQuery,\n JsonDataInfo,\n PFrameHandle,\n PObjectId,\n PTableColumnSpec,\n PTableDef,\n PTableHandle,\n SpecQuery,\n} from \"@milaboratories/pl-model-common\";\nimport { traverseQuerySpec } from \"@milaboratories/pl-model-common\";\nimport { hashJson, PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\n\n/**\n * Make every inline column in a `SpecQuery` self-contained by embedding its\n * column `typeSpec` (`{ axes, column }`) into `dataInfo`, derived from the\n * column's `PColumnSpec`.\n */\nexport function embedInlineColumnTypeSpecs(query: SpecQuery): SpecQuery {\n return traverseQuerySpec(query, {\n column: (c) => c,\n node: (node) => {\n if (node.type !== \"inlineColumn\") return node;\n const { axesSpec, valueType } = node.spec.spec;\n const dataInfo: JsonDataInfo & { typeSpec: PFrameInternal.PColumnValueTypeSpec } = {\n ...node.dataInfo,\n typeSpec: { axes: axesSpec.map((a) => a.type), column: valueType },\n };\n return { ...node, dataInfo };\n },\n });\n}\n\n/**\n * PTable definition stored in the def / table pools. Always\n * carries a pre-lowered data query plus the corresponding output\n * `tableSpec`. Legacy `PTableDef<PObjectId>` inputs are lowered to\n * this shape via WASM-spec at acquire time.\n */\nexport type FullPTableDef = {\n pFrameHandle: PFrameHandle;\n tableSpec: PTableColumnSpec[];\n dataQuery: DataQuery;\n};\n\nexport function stableKeyFromFullPTableDef(data: FullPTableDef): PTableHandle {\n return hashJson(data) as string as PTableHandle;\n}\n\n/**\n * Lower a legacy `PTableDef<PObjectId>` to the data layer. Returns\n * the output `tableSpec` and the lowered `dataQuery`. Routes through\n * `rewriteLegacyQuery` + `evaluateQuery` on the caller-supplied\n * WASM-spec frame.\n */\nexport function lowerLegacyPTableDef(\n pFrameSpec: PFrameInternal.PFrameWasmV3,\n legacyDef: PTableDef<PObjectId>,\n): { tableSpec: PTableColumnSpec[]; dataQuery: DataQuery } {\n const legacy: PFrameInternal.LegacyQuery = {\n src: legacyDef.src,\n filters: [...legacyDef.partitionFilters, ...legacyDef.filters],\n sorting: legacyDef.sorting,\n };\n return pFrameSpec.evaluateQuery(\n embedInlineColumnTypeSpecs(pFrameSpec.rewriteLegacyQuery(legacy)),\n );\n}\n\n/**\n * Build a `FullPTableDef` from a legacy `PTableDef` plus the\n * PFrame's WASM-spec frame. Used by pool `acquireFromLegacy` methods\n * to keep lowering off the call site.\n */\nexport function buildFullPTableDefFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n}): FullPTableDef {\n return {\n pFrameHandle: opts.pFrameHandle,\n ...lowerLegacyPTableDef(opts.pFrameSpec, opts.def),\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ptable_shared.cjs","names":[],"sources":["../src/ptable_shared.ts"],"sourcesContent":["import type {\n DataQuery,\n JsonDataInfo,\n PFrameHandle,\n PObjectId,\n PTableColumnSpec,\n PTableDef,\n PTableHandle,\n SpecQuery,\n} from \"@milaboratories/pl-model-common\";\nimport { traverseQuerySpec } from \"@milaboratories/pl-model-common\";\nimport { hashJson, PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\n\n/**\n * Make every inline column in a `SpecQuery` self-contained by embedding its\n * column `typeSpec` (`{ axes, column }`) into `dataInfo`, derived from the\n * column's `PColumnSpec`.\n */\nexport function embedInlineColumnTypeSpecs(query: SpecQuery): SpecQuery {\n return traverseQuerySpec(query, {\n column: (c) => c,\n node: (node) => {\n if (node.type !== \"inlineColumn\") return node;\n const { axesSpec, valueType } = node.spec.spec;\n const dataInfo: JsonDataInfo & { typeSpec: PFrameInternal.PColumnValueTypeSpec } = {\n ...node.dataInfo,\n typeSpec: { axes: axesSpec.map((a) => a.type), column: valueType },\n };\n return { ...node, dataInfo };\n },\n });\n}\n\n/**\n * PTable definition stored in the def / table pools. Always\n * carries a pre-lowered data query plus the corresponding output\n * `tableSpec`. Legacy `PTableDef<PObjectId>` inputs are lowered to\n * this shape via WASM-spec at acquire time.\n */\nexport type FullPTableDef = {\n pFrameHandle: PFrameHandle;\n tableSpec: PTableColumnSpec[];\n dataQuery: DataQuery;\n};\n\nexport function stableKeyFromFullPTableDef(data: FullPTableDef): PTableHandle {\n return hashJson(data) as string as PTableHandle;\n}\n\n/**\n * Lower a legacy `PTableDef<PObjectId>` to the data layer. Returns\n * the output `tableSpec` and the lowered `dataQuery`. Routes through\n * `rewriteLegacyQuery` + `evaluateQuery` on the caller-supplied\n * WASM-spec frame.\n */\nexport function lowerLegacyPTableDef(\n pFrameSpec: PFrameInternal.PFrameWasmV3,\n legacyDef: PTableDef<PObjectId>,\n): { tableSpec: PTableColumnSpec[]; dataQuery: DataQuery } {\n const legacy: PFrameInternal.LegacyQuery = {\n src: legacyDef.src,\n filters: [...legacyDef.partitionFilters, ...legacyDef.filters],\n sorting: legacyDef.sorting,\n };\n return pFrameSpec.evaluateQuery(\n embedInlineColumnTypeSpecs(pFrameSpec.rewriteLegacyQuery(legacy)),\n );\n}\n\n/**\n * Build a `FullPTableDef` from a legacy `PTableDef` plus the\n * PFrame's WASM-spec frame. Used by pool `acquireFromLegacy` methods\n * to keep lowering off the call site.\n */\nexport function buildFullPTableDefFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n}): FullPTableDef {\n return {\n pFrameHandle: opts.pFrameHandle,\n ...lowerLegacyPTableDef(opts.pFrameSpec, opts.def),\n };\n}\n"],"mappings":";;;;;;;;AAkBA,SAAgB,2BAA2B,OAA6B;CACtE,QAAA,GAAA,gCAAA,kBAAA,CAAyB,OAAO;EAC9B,SAAS,MAAM;EACf,OAAO,SAAS;GACd,IAAI,KAAK,SAAS,gBAAgB,OAAO;GACzC,MAAM,EAAE,UAAU,cAAc,KAAK,KAAK;GAC1C,MAAM,WAA6E;IACjF,GAAG,KAAK;IACR,UAAU;KAAE,MAAM,SAAS,KAAK,MAAM,EAAE,IAAI;KAAG,QAAQ;IAAU;GACnE;GACA,OAAO;IAAE,GAAG;IAAM;GAAS;EAC7B;CACF,CAAC;AACH;AAcA,SAAgB,2BAA2B,MAAmC;CAC5E,QAAA,GAAA,sCAAA,SAAA,CAAgB,IAAI;AACtB;;;;;;;AAQA,SAAgB,qBACd,YACA,WACyD;CACzD,MAAM,SAAqC;EACzC,KAAK,UAAU;EACf,SAAS,CAAC,GAAG,UAAU,kBAAkB,GAAG,UAAU,OAAO;EAC7D,SAAS,UAAU;CACrB;CACA,OAAO,WAAW,cAChB,2BAA2B,WAAW,mBAAmB,MAAM,CAAC,CAClE;AACF;;;;;;AAOA,SAAgB,6BAA6B,MAI3B;CAChB,OAAO;EACL,cAAc,KAAK;EACnB,GAAG,qBAAqB,KAAK,YAAY,KAAK,GAAG;CACnD;AACF"}
|
package/dist/ptable_shared.js
CHANGED
|
@@ -55,6 +55,6 @@ function buildFullPTableDefFromLegacy(opts) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
|
-
export { buildFullPTableDefFromLegacy, embedInlineColumnTypeSpecs, stableKeyFromFullPTableDef };
|
|
58
|
+
export { buildFullPTableDefFromLegacy, embedInlineColumnTypeSpecs, lowerLegacyPTableDef, stableKeyFromFullPTableDef };
|
|
59
59
|
|
|
60
60
|
//# sourceMappingURL=ptable_shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ptable_shared.js","names":[],"sources":["../src/ptable_shared.ts"],"sourcesContent":["import type {\n DataQuery,\n JsonDataInfo,\n PFrameHandle,\n PObjectId,\n PTableColumnSpec,\n PTableDef,\n PTableHandle,\n SpecQuery,\n} from \"@milaboratories/pl-model-common\";\nimport { traverseQuerySpec } from \"@milaboratories/pl-model-common\";\nimport { hashJson, PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\n\n/**\n * Make every inline column in a `SpecQuery` self-contained by embedding its\n * column `typeSpec` (`{ axes, column }`) into `dataInfo`, derived from the\n * column's `PColumnSpec`.\n */\nexport function embedInlineColumnTypeSpecs(query: SpecQuery): SpecQuery {\n return traverseQuerySpec(query, {\n column: (c) => c,\n node: (node) => {\n if (node.type !== \"inlineColumn\") return node;\n const { axesSpec, valueType } = node.spec.spec;\n const dataInfo: JsonDataInfo & { typeSpec: PFrameInternal.PColumnValueTypeSpec } = {\n ...node.dataInfo,\n typeSpec: { axes: axesSpec.map((a) => a.type), column: valueType },\n };\n return { ...node, dataInfo };\n },\n });\n}\n\n/**\n * PTable definition stored in the def / table pools. Always\n * carries a pre-lowered data query plus the corresponding output\n * `tableSpec`. Legacy `PTableDef<PObjectId>` inputs are lowered to\n * this shape via WASM-spec at acquire time.\n */\nexport type FullPTableDef = {\n pFrameHandle: PFrameHandle;\n tableSpec: PTableColumnSpec[];\n dataQuery: DataQuery;\n};\n\nexport function stableKeyFromFullPTableDef(data: FullPTableDef): PTableHandle {\n return hashJson(data) as string as PTableHandle;\n}\n\n/**\n * Lower a legacy `PTableDef<PObjectId>` to the data layer. Returns\n * the output `tableSpec` and the lowered `dataQuery`. Routes through\n * `rewriteLegacyQuery` + `evaluateQuery` on the caller-supplied\n * WASM-spec frame.\n */\nexport function lowerLegacyPTableDef(\n pFrameSpec: PFrameInternal.PFrameWasmV3,\n legacyDef: PTableDef<PObjectId>,\n): { tableSpec: PTableColumnSpec[]; dataQuery: DataQuery } {\n const legacy: PFrameInternal.LegacyQuery = {\n src: legacyDef.src,\n filters: [...legacyDef.partitionFilters, ...legacyDef.filters],\n sorting: legacyDef.sorting,\n };\n return pFrameSpec.evaluateQuery(\n embedInlineColumnTypeSpecs(pFrameSpec.rewriteLegacyQuery(legacy)),\n );\n}\n\n/**\n * Build a `FullPTableDef` from a legacy `PTableDef` plus the\n * PFrame's WASM-spec frame. Used by pool `acquireFromLegacy` methods\n * to keep lowering off the call site.\n */\nexport function buildFullPTableDefFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n}): FullPTableDef {\n return {\n pFrameHandle: opts.pFrameHandle,\n ...lowerLegacyPTableDef(opts.pFrameSpec, opts.def),\n };\n}\n"],"mappings":";;;;;;;;AAkBA,SAAgB,2BAA2B,OAA6B;
|
|
1
|
+
{"version":3,"file":"ptable_shared.js","names":[],"sources":["../src/ptable_shared.ts"],"sourcesContent":["import type {\n DataQuery,\n JsonDataInfo,\n PFrameHandle,\n PObjectId,\n PTableColumnSpec,\n PTableDef,\n PTableHandle,\n SpecQuery,\n} from \"@milaboratories/pl-model-common\";\nimport { traverseQuerySpec } from \"@milaboratories/pl-model-common\";\nimport { hashJson, PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\n\n/**\n * Make every inline column in a `SpecQuery` self-contained by embedding its\n * column `typeSpec` (`{ axes, column }`) into `dataInfo`, derived from the\n * column's `PColumnSpec`.\n */\nexport function embedInlineColumnTypeSpecs(query: SpecQuery): SpecQuery {\n return traverseQuerySpec(query, {\n column: (c) => c,\n node: (node) => {\n if (node.type !== \"inlineColumn\") return node;\n const { axesSpec, valueType } = node.spec.spec;\n const dataInfo: JsonDataInfo & { typeSpec: PFrameInternal.PColumnValueTypeSpec } = {\n ...node.dataInfo,\n typeSpec: { axes: axesSpec.map((a) => a.type), column: valueType },\n };\n return { ...node, dataInfo };\n },\n });\n}\n\n/**\n * PTable definition stored in the def / table pools. Always\n * carries a pre-lowered data query plus the corresponding output\n * `tableSpec`. Legacy `PTableDef<PObjectId>` inputs are lowered to\n * this shape via WASM-spec at acquire time.\n */\nexport type FullPTableDef = {\n pFrameHandle: PFrameHandle;\n tableSpec: PTableColumnSpec[];\n dataQuery: DataQuery;\n};\n\nexport function stableKeyFromFullPTableDef(data: FullPTableDef): PTableHandle {\n return hashJson(data) as string as PTableHandle;\n}\n\n/**\n * Lower a legacy `PTableDef<PObjectId>` to the data layer. Returns\n * the output `tableSpec` and the lowered `dataQuery`. Routes through\n * `rewriteLegacyQuery` + `evaluateQuery` on the caller-supplied\n * WASM-spec frame.\n */\nexport function lowerLegacyPTableDef(\n pFrameSpec: PFrameInternal.PFrameWasmV3,\n legacyDef: PTableDef<PObjectId>,\n): { tableSpec: PTableColumnSpec[]; dataQuery: DataQuery } {\n const legacy: PFrameInternal.LegacyQuery = {\n src: legacyDef.src,\n filters: [...legacyDef.partitionFilters, ...legacyDef.filters],\n sorting: legacyDef.sorting,\n };\n return pFrameSpec.evaluateQuery(\n embedInlineColumnTypeSpecs(pFrameSpec.rewriteLegacyQuery(legacy)),\n );\n}\n\n/**\n * Build a `FullPTableDef` from a legacy `PTableDef` plus the\n * PFrame's WASM-spec frame. Used by pool `acquireFromLegacy` methods\n * to keep lowering off the call site.\n */\nexport function buildFullPTableDefFromLegacy(opts: {\n pFrameHandle: PFrameHandle;\n def: PTableDef<PObjectId>;\n pFrameSpec: PFrameInternal.PFrameWasmV3;\n}): FullPTableDef {\n return {\n pFrameHandle: opts.pFrameHandle,\n ...lowerLegacyPTableDef(opts.pFrameSpec, opts.def),\n };\n}\n"],"mappings":";;;;;;;;AAkBA,SAAgB,2BAA2B,OAA6B;CACtE,OAAO,kBAAkB,OAAO;EAC9B,SAAS,MAAM;EACf,OAAO,SAAS;GACd,IAAI,KAAK,SAAS,gBAAgB,OAAO;GACzC,MAAM,EAAE,UAAU,cAAc,KAAK,KAAK;GAC1C,MAAM,WAA6E;IACjF,GAAG,KAAK;IACR,UAAU;KAAE,MAAM,SAAS,KAAK,MAAM,EAAE,IAAI;KAAG,QAAQ;IAAU;GACnE;GACA,OAAO;IAAE,GAAG;IAAM;GAAS;EAC7B;CACF,CAAC;AACH;AAcA,SAAgB,2BAA2B,MAAmC;CAC5E,OAAO,SAAS,IAAI;AACtB;;;;;;;AAQA,SAAgB,qBACd,YACA,WACyD;CACzD,MAAM,SAAqC;EACzC,KAAK,UAAU;EACf,SAAS,CAAC,GAAG,UAAU,kBAAkB,GAAG,UAAU,OAAO;EAC7D,SAAS,UAAU;CACrB;CACA,OAAO,WAAW,cAChB,2BAA2B,WAAW,mBAAmB,MAAM,CAAC,CAClE;AACF;;;;;;AAOA,SAAgB,6BAA6B,MAI3B;CAChB,OAAO;EACL,cAAc,KAAK;EACnB,GAAG,qBAAqB,KAAK,YAAY,KAAK,GAAG;CACnD;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pf-driver",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.14",
|
|
4
4
|
"description": "PFrameDriver implementation abstracted from Middle Layer",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@milaboratories/pframes-rs-node": "1.1.
|
|
24
|
-
"@milaboratories/pframes-rs-wasm": "1.1.
|
|
23
|
+
"@milaboratories/pframes-rs-node": "1.1.52",
|
|
24
|
+
"@milaboratories/pframes-rs-wasm": "1.1.52",
|
|
25
25
|
"es-toolkit": "^1.39.10",
|
|
26
26
|
"lru-cache": "^11.2.2",
|
|
27
27
|
"@milaboratories/helpers": "1.14.2",
|
|
28
28
|
"@milaboratories/pl-model-common": "1.46.2",
|
|
29
|
-
"@milaboratories/
|
|
30
|
-
"@milaboratories/
|
|
29
|
+
"@milaboratories/pl-model-middle-layer": "1.30.9",
|
|
30
|
+
"@milaboratories/ts-helpers": "1.8.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "~24.5.2",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"fast-csv": "5.0.5",
|
|
36
36
|
"typescript": "~5.9.3",
|
|
37
37
|
"vitest": "^4.1.3",
|
|
38
|
+
"@milaboratories/ts-configs": "1.3.0",
|
|
38
39
|
"@milaboratories/build-configs": "2.0.0",
|
|
39
|
-
"@milaboratories/ts-builder": "1.
|
|
40
|
-
"@milaboratories/ts-configs": "1.2.3"
|
|
40
|
+
"@milaboratories/ts-builder": "1.6.0"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=22.19.0"
|