@devrev/meerkat-node 0.0.101 → 0.0.103
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.
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "cubeQueryToSQLWithResolution", {
|
|
|
7
7
|
});
|
|
8
8
|
const _meerkatcore = require("@devrev/meerkat-core");
|
|
9
9
|
const _cubetosql = require("../cube-to-sql/cube-to-sql");
|
|
10
|
-
const cubeQueryToSQLWithResolution = async ({ query, tableSchemas, resolutionConfig, contextParams })=>{
|
|
10
|
+
const cubeQueryToSQLWithResolution = async ({ query, tableSchemas, resolutionConfig, columnProjections, contextParams })=>{
|
|
11
11
|
const baseSql = await (0, _cubetosql.cubeQueryToSQL)({
|
|
12
12
|
query,
|
|
13
13
|
tableSchemas,
|
|
@@ -23,7 +23,7 @@ const cubeQueryToSQLWithResolution = async ({ query, tableSchemas, resolutionCon
|
|
|
23
23
|
const resolveParams = {
|
|
24
24
|
query: {
|
|
25
25
|
measures: [],
|
|
26
|
-
dimensions: (0, _meerkatcore.generateResolvedDimensions)(query, resolutionConfig),
|
|
26
|
+
dimensions: (0, _meerkatcore.generateResolvedDimensions)(query, resolutionConfig, columnProjections),
|
|
27
27
|
joinPaths: (0, _meerkatcore.generateResolutionJoinPaths)(resolutionConfig, tableSchemas)
|
|
28
28
|
},
|
|
29
29
|
tableSchemas: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../meerkat-node/src/cube-to-sql-with-resolution/cube-to-sql-with-resolution.ts"],"sourcesContent":["import {\n ContextParams,\n createBaseTableSchema,\n generateResolutionJoinPaths,\n generateResolutionSchemas,\n generateResolvedDimensions,\n Query,\n ResolutionConfig,\n TableSchema,\n} from '@devrev/meerkat-core';\nimport {\n cubeQueryToSQL,\n CubeQueryToSQLParams,\n} from '../cube-to-sql/cube-to-sql';\n\nexport interface CubeQueryToSQLWithResolutionParams {\n query: Query;\n tableSchemas: TableSchema[];\n resolutionConfig: ResolutionConfig;\n contextParams?: ContextParams;\n}\n\nexport const cubeQueryToSQLWithResolution = async ({\n query,\n tableSchemas,\n resolutionConfig,\n contextParams,\n}: CubeQueryToSQLWithResolutionParams) => {\n const baseSql = await cubeQueryToSQL({\n query,\n tableSchemas,\n contextParams,\n });\n\n if (resolutionConfig.columnConfigs.length === 0) {\n // If no resolution is needed, return the base SQL.\n return baseSql;\n }\n\n // Create a table schema for the base query.\n const baseTable: TableSchema = createBaseTableSchema(\n baseSql,\n tableSchemas,\n resolutionConfig,\n query.measures,\n query.dimensions\n );\n\n const resolutionSchemas: TableSchema[] = generateResolutionSchemas(\n resolutionConfig,\n tableSchemas\n );\n\n const resolveParams: CubeQueryToSQLParams = {\n query: {\n measures: [],\n dimensions: generateResolvedDimensions(query
|
|
1
|
+
{"version":3,"sources":["../../../meerkat-node/src/cube-to-sql-with-resolution/cube-to-sql-with-resolution.ts"],"sourcesContent":["import {\n ContextParams,\n createBaseTableSchema,\n generateResolutionJoinPaths,\n generateResolutionSchemas,\n generateResolvedDimensions,\n Query,\n ResolutionConfig,\n TableSchema,\n} from '@devrev/meerkat-core';\nimport {\n cubeQueryToSQL,\n CubeQueryToSQLParams,\n} from '../cube-to-sql/cube-to-sql';\n\nexport interface CubeQueryToSQLWithResolutionParams {\n query: Query;\n tableSchemas: TableSchema[];\n resolutionConfig: ResolutionConfig;\n columnProjections?: string[];\n contextParams?: ContextParams;\n}\n\nexport const cubeQueryToSQLWithResolution = async ({\n query,\n tableSchemas,\n resolutionConfig,\n columnProjections,\n contextParams,\n}: CubeQueryToSQLWithResolutionParams) => {\n const baseSql = await cubeQueryToSQL({\n query,\n tableSchemas,\n contextParams,\n });\n\n if (resolutionConfig.columnConfigs.length === 0) {\n // If no resolution is needed, return the base SQL.\n return baseSql;\n }\n\n // Create a table schema for the base query.\n const baseTable: TableSchema = createBaseTableSchema(\n baseSql,\n tableSchemas,\n resolutionConfig,\n query.measures,\n query.dimensions\n );\n\n const resolutionSchemas: TableSchema[] = generateResolutionSchemas(\n resolutionConfig,\n tableSchemas\n );\n\n const resolveParams: CubeQueryToSQLParams = {\n query: {\n measures: [],\n dimensions: generateResolvedDimensions(\n query,\n resolutionConfig,\n columnProjections\n ),\n joinPaths: generateResolutionJoinPaths(resolutionConfig, tableSchemas),\n },\n tableSchemas: [baseTable, ...resolutionSchemas],\n };\n const sql = await cubeQueryToSQL(resolveParams);\n\n return sql;\n};\n"],"names":["cubeQueryToSQLWithResolution","query","tableSchemas","resolutionConfig","columnProjections","contextParams","baseSql","cubeQueryToSQL","columnConfigs","length","baseTable","createBaseTableSchema","measures","dimensions","resolutionSchemas","generateResolutionSchemas","resolveParams","generateResolvedDimensions","joinPaths","generateResolutionJoinPaths","sql"],"mappings":";+BAuBaA;;;eAAAA;;;6BAdN;2BAIA;AAUA,MAAMA,+BAA+B,OAAO,EACjDC,KAAK,EACLC,YAAY,EACZC,gBAAgB,EAChBC,iBAAiB,EACjBC,aAAa,EACsB;IACnC,MAAMC,UAAU,MAAMC,IAAAA,yBAAc,EAAC;QACnCN;QACAC;QACAG;IACF;IAEA,IAAIF,iBAAiBK,aAAa,CAACC,MAAM,KAAK,GAAG;QAC/C,mDAAmD;QACnD,OAAOH;IACT;IAEA,4CAA4C;IAC5C,MAAMI,YAAyBC,IAAAA,kCAAqB,EAClDL,SACAJ,cACAC,kBACAF,MAAMW,QAAQ,EACdX,MAAMY,UAAU;IAGlB,MAAMC,oBAAmCC,IAAAA,sCAAyB,EAChEZ,kBACAD;IAGF,MAAMc,gBAAsC;QAC1Cf,OAAO;YACLW,UAAU,EAAE;YACZC,YAAYI,IAAAA,uCAA0B,EACpChB,OACAE,kBACAC;YAEFc,WAAWC,IAAAA,wCAA2B,EAAChB,kBAAkBD;QAC3D;QACAA,cAAc;YAACQ;eAAcI;SAAkB;IACjD;IACA,MAAMM,MAAM,MAAMb,IAAAA,yBAAc,EAACS;IAEjC,OAAOI;AACT"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devrev/meerkat-node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.103",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@swc/helpers": "~0.5.0",
|
|
6
6
|
"@devrev/meerkat-core": "*",
|
|
7
|
-
"axios": "^1.
|
|
7
|
+
"axios": "^1.12.0",
|
|
8
8
|
"lodash": "^4.17.21",
|
|
9
|
-
"duckdb": "^1.
|
|
9
|
+
"duckdb": "^1.3.4"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"release": "semantic-release"
|
|
@@ -3,6 +3,7 @@ export interface CubeQueryToSQLWithResolutionParams {
|
|
|
3
3
|
query: Query;
|
|
4
4
|
tableSchemas: TableSchema[];
|
|
5
5
|
resolutionConfig: ResolutionConfig;
|
|
6
|
+
columnProjections?: string[];
|
|
6
7
|
contextParams?: ContextParams;
|
|
7
8
|
}
|
|
8
|
-
export declare const cubeQueryToSQLWithResolution: ({ query, tableSchemas, resolutionConfig, contextParams, }: CubeQueryToSQLWithResolutionParams) => Promise<string>;
|
|
9
|
+
export declare const cubeQueryToSQLWithResolution: ({ query, tableSchemas, resolutionConfig, columnProjections, contextParams, }: CubeQueryToSQLWithResolutionParams) => Promise<string>;
|