drizzle-cube 0.5.6 → 0.5.8
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/{server/dist-DxegvyZF.cjs → adapters/dist-BOdf-GQO.cjs} +1 -1
- package/dist/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +4 -4
- package/dist/adapters/fastify/index.cjs +2 -2
- package/dist/adapters/fastify/index.js +4 -4
- package/dist/{server/google-BXwMolCu.js → adapters/google-CFYljAOF.js} +1 -1
- package/dist/adapters/{google-Dgo9-Kb5.cjs → google-DUlXeeDA.cjs} +1 -1
- package/dist/adapters/{handler-Odsi9_Rd.js → handler-Cx8QYLk6.js} +20 -6
- package/dist/adapters/{handler-C0nUppAK.cjs → handler-CzbCuS6_.cjs} +4 -4
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +7 -7
- package/dist/adapters/{locale-Dy3LcTwN.js → locale-BPB7flIG.js} +16 -1
- package/dist/adapters/{locale-Dv6bl_eU.cjs → locale-tIMrNcCr.cjs} +6 -6
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +2 -2
- package/dist/adapters/mcp-transport-C2QzXm6h.cjs +40 -0
- package/dist/adapters/mcp-transport-D0B3S1tB.js +579 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +4 -4
- package/dist/{server/openai-zpXlGbbF.js → adapters/openai-B5jEiqiB.js} +2139 -948
- package/dist/{server/openai-CLWSwD-D.js → adapters/openai-BZdAA7Ji.js} +1 -1
- package/dist/adapters/openai-D0musiYP.cjs +17 -0
- package/dist/adapters/{openai-BjLV_Wjx.cjs → openai-D_U4V0kT.cjs} +1 -1
- package/dist/adapters/{utils-Bd5mzZfk.js → utils-D9JPLmfl.js} +24 -10
- package/dist/adapters/{utils-DklqMBHn.cjs → utils-KV37IBIv.cjs} +4 -4
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.js +1 -1
- package/dist/client/charts/ChartLoader.d.ts +1 -1
- package/dist/client/charts.js +13 -13
- package/dist/client/chunks/DashboardEditModal-CjCIAT-J.js +9682 -0
- package/dist/client/chunks/DashboardEditModal-CjCIAT-J.js.map +1 -0
- package/dist/client/chunks/{RetentionCombinedChart-CivIny9P.js → RetentionCombinedChart-BPkfcTa8.js} +4 -4
- package/dist/client/chunks/{RetentionCombinedChart-CivIny9P.js.map → RetentionCombinedChart-BPkfcTa8.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-BHCgwZmB.js → RetentionHeatmap-DGzLzr7h.js} +3 -3
- package/dist/client/chunks/{RetentionHeatmap-BHCgwZmB.js.map → RetentionHeatmap-DGzLzr7h.js.map} +1 -1
- package/dist/client/chunks/{af-ZA-BdL6DOWy.js → af-ZA-BTaChuqI.js} +1 -1
- package/dist/client/chunks/{af-ZA-BdL6DOWy.js.map → af-ZA-BTaChuqI.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-MoGvbMRe.js → analysis-builder-MuMIzoRq.js} +244 -244
- package/dist/client/chunks/{analysis-builder-MoGvbMRe.js.map → analysis-builder-MuMIzoRq.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-shared-DmyRh2O3.js → analysis-builder-shared-CYVwSPqt.js} +289 -289
- package/dist/client/chunks/{analysis-builder-shared-DmyRh2O3.js.map → analysis-builder-shared-CYVwSPqt.js.map} +1 -1
- package/dist/client/chunks/{chart-activity-grid-Bdb8U_NC.js → chart-activity-grid-DmruKPab.js} +13 -8
- package/dist/client/chunks/{chart-activity-grid-Bdb8U_NC.js.map → chart-activity-grid-DmruKPab.js.map} +1 -1
- package/dist/client/chunks/{chart-area-BZEnT-tf.js → chart-area-DHCPM4Em.js} +3 -3
- package/dist/client/chunks/{chart-area-BZEnT-tf.js.map → chart-area-DHCPM4Em.js.map} +1 -1
- package/dist/client/chunks/{chart-bar-CTmdv_v0.js → chart-bar-KddciGDv.js} +4 -4
- package/dist/client/chunks/{chart-bar-CTmdv_v0.js.map → chart-bar-KddciGDv.js.map} +1 -1
- package/dist/client/chunks/{chart-box-plot-CYObdFtp.js → chart-box-plot-DYKfyOI8.js} +3 -3
- package/dist/client/chunks/{chart-box-plot-CYObdFtp.js.map → chart-box-plot-DYKfyOI8.js.map} +1 -1
- package/dist/client/chunks/{chart-bubble-CjFprySz.js → chart-bubble-CfqiB538.js} +3 -3
- package/dist/client/chunks/{chart-bubble-CjFprySz.js.map → chart-bubble-CfqiB538.js.map} +1 -1
- package/dist/client/chunks/{chart-candlestick-D2HoM3B5.js → chart-candlestick-Dwc92Mrj.js} +3 -3
- package/dist/client/chunks/{chart-candlestick-D2HoM3B5.js.map → chart-candlestick-Dwc92Mrj.js.map} +1 -1
- package/dist/client/chunks/{chart-config-activity-grid-Bom99j9m.js → chart-config-activity-grid-D_UX4NHC.js} +2 -2
- package/dist/client/chunks/{chart-config-activity-grid-Bom99j9m.js.map → chart-config-activity-grid-D_UX4NHC.js.map} +1 -1
- package/dist/client/chunks/{chart-config-area-DtYTKZxS.js → chart-config-area-Bq_UsW3x.js} +2 -2
- package/dist/client/chunks/{chart-config-area-DtYTKZxS.js.map → chart-config-area-Bq_UsW3x.js.map} +1 -1
- package/dist/client/chunks/{chart-config-bar-7v5JVY2y.js → chart-config-bar-_JEGZnAu.js} +2 -2
- package/dist/client/chunks/{chart-config-bar-7v5JVY2y.js.map → chart-config-bar-_JEGZnAu.js.map} +1 -1
- package/dist/client/chunks/{chart-config-box-plot-BHGv-wqu.js → chart-config-box-plot-DJ-dWWXA.js} +2 -2
- package/dist/client/chunks/{chart-config-box-plot-BHGv-wqu.js.map → chart-config-box-plot-DJ-dWWXA.js.map} +1 -1
- package/dist/client/chunks/{chart-config-bubble-BkHm-mfu.js → chart-config-bubble-gIoqVyjZ.js} +2 -2
- package/dist/client/chunks/{chart-config-bubble-BkHm-mfu.js.map → chart-config-bubble-gIoqVyjZ.js.map} +1 -1
- package/dist/client/chunks/{chart-config-candlestick-D1aaHvTe.js → chart-config-candlestick-N6DchAA3.js} +2 -2
- package/dist/client/chunks/{chart-config-candlestick-D1aaHvTe.js.map → chart-config-candlestick-N6DchAA3.js.map} +1 -1
- package/dist/client/chunks/{chart-config-data-table-B_Hw8w2J.js → chart-config-data-table-d7VBY-y_.js} +2 -2
- package/dist/client/chunks/{chart-config-data-table-B_Hw8w2J.js.map → chart-config-data-table-d7VBY-y_.js.map} +1 -1
- package/dist/client/chunks/{chart-config-funnel-DL8PSGuL.js → chart-config-funnel-DEYMcxsD.js} +2 -2
- package/dist/client/chunks/{chart-config-funnel-DL8PSGuL.js.map → chart-config-funnel-DEYMcxsD.js.map} +1 -1
- package/dist/client/chunks/{chart-config-gauge-BVLxuA3f.js → chart-config-gauge-DSwC04l0.js} +2 -2
- package/dist/client/chunks/{chart-config-gauge-BVLxuA3f.js.map → chart-config-gauge-DSwC04l0.js.map} +1 -1
- package/dist/client/chunks/{chart-config-heat-map-CjudGdui.js → chart-config-heat-map-CfRnRNcw.js} +2 -2
- package/dist/client/chunks/{chart-config-heat-map-CjudGdui.js.map → chart-config-heat-map-CfRnRNcw.js.map} +1 -1
- package/dist/client/chunks/{chart-config-kpi-delta-Bf47hGqD.js → chart-config-kpi-delta-D6BIkHL3.js} +2 -2
- package/dist/client/chunks/{chart-config-kpi-delta-Bf47hGqD.js.map → chart-config-kpi-delta-D6BIkHL3.js.map} +1 -1
- package/dist/client/chunks/{chart-config-kpi-number-QTQRNgOi.js → chart-config-kpi-number-Bx-V9a62.js} +2 -2
- package/dist/client/chunks/{chart-config-kpi-number-QTQRNgOi.js.map → chart-config-kpi-number-Bx-V9a62.js.map} +1 -1
- package/dist/client/chunks/{chart-config-kpi-text-BRze2eyh.js → chart-config-kpi-text-CcqC1u-8.js} +2 -2
- package/dist/client/chunks/{chart-config-kpi-text-BRze2eyh.js.map → chart-config-kpi-text-CcqC1u-8.js.map} +1 -1
- package/dist/client/chunks/{chart-config-line-BFeCqmKH.js → chart-config-line-Db3jDsWc.js} +2 -2
- package/dist/client/chunks/{chart-config-line-BFeCqmKH.js.map → chart-config-line-Db3jDsWc.js.map} +1 -1
- package/dist/client/chunks/{chart-config-markdown-EWYckwXv.js → chart-config-markdown-BtRIe8JN.js} +2 -2
- package/dist/client/chunks/{chart-config-markdown-EWYckwXv.js.map → chart-config-markdown-BtRIe8JN.js.map} +1 -1
- package/dist/client/chunks/{chart-config-measure-profile-B9nIhqKR.js → chart-config-measure-profile-DxRGa-zf.js} +2 -2
- package/dist/client/chunks/{chart-config-measure-profile-B9nIhqKR.js.map → chart-config-measure-profile-DxRGa-zf.js.map} +1 -1
- package/dist/client/chunks/{chart-config-pie-6LHtEyMM.js → chart-config-pie-DD4SmRTF.js} +2 -2
- package/dist/client/chunks/{chart-config-pie-6LHtEyMM.js.map → chart-config-pie-DD4SmRTF.js.map} +1 -1
- package/dist/client/chunks/{chart-config-radar-BuLS6Inn.js → chart-config-radar-CC2XAaGr.js} +2 -2
- package/dist/client/chunks/{chart-config-radar-BuLS6Inn.js.map → chart-config-radar-CC2XAaGr.js.map} +1 -1
- package/dist/client/chunks/{chart-config-radial-bar-BP0eMohx.js → chart-config-radial-bar-DmxKx1R0.js} +2 -2
- package/dist/client/chunks/{chart-config-radial-bar-BP0eMohx.js.map → chart-config-radial-bar-DmxKx1R0.js.map} +1 -1
- package/dist/client/chunks/{chart-config-sankey-CT8oGIGP.js → chart-config-sankey-BTnWA7EW.js} +2 -2
- package/dist/client/chunks/{chart-config-sankey-CT8oGIGP.js.map → chart-config-sankey-BTnWA7EW.js.map} +1 -1
- package/dist/client/chunks/{chart-config-scatter-DOSpN07Z.js → chart-config-scatter-DSYTjwRb.js} +2 -2
- package/dist/client/chunks/{chart-config-scatter-DOSpN07Z.js.map → chart-config-scatter-DSYTjwRb.js.map} +1 -1
- package/dist/client/chunks/{chart-config-sunburst-BSUX_YoB.js → chart-config-sunburst-Bwjtdf7X.js} +2 -2
- package/dist/client/chunks/{chart-config-sunburst-BSUX_YoB.js.map → chart-config-sunburst-Bwjtdf7X.js.map} +1 -1
- package/dist/client/chunks/{chart-config-tree-map-D8GuAgVB.js → chart-config-tree-map-BI-oQStO.js} +2 -2
- package/dist/client/chunks/{chart-config-tree-map-D8GuAgVB.js.map → chart-config-tree-map-BI-oQStO.js.map} +1 -1
- package/dist/client/chunks/{chart-config-waterfall-BDi7BoJP.js → chart-config-waterfall-DSnyixbI.js} +2 -2
- package/dist/client/chunks/{chart-config-waterfall-BDi7BoJP.js.map → chart-config-waterfall-DSnyixbI.js.map} +1 -1
- package/dist/client/chunks/{chart-data-table-DT4uBZaq.js → chart-data-table-BO4sXsim.js} +842 -834
- package/dist/client/chunks/chart-data-table-BO4sXsim.js.map +1 -0
- package/dist/client/chunks/{chart-funnel-B9crR3b3.js → chart-funnel-DnWRsmnS.js} +3 -3
- package/dist/client/chunks/{chart-funnel-B9crR3b3.js.map → chart-funnel-DnWRsmnS.js.map} +1 -1
- package/dist/client/chunks/{chart-gauge-DAMFsicz.js → chart-gauge-CgMeqeGb.js} +3 -3
- package/dist/client/chunks/{chart-gauge-DAMFsicz.js.map → chart-gauge-CgMeqeGb.js.map} +1 -1
- package/dist/client/chunks/{chart-heat-map-BxgM_X1G.js → chart-heat-map-DcGm9SWK.js} +3 -3
- package/dist/client/chunks/{chart-heat-map-BxgM_X1G.js.map → chart-heat-map-DcGm9SWK.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-DJKL02Ut.js → chart-kpi-delta-C2wKPqCb.js} +6 -6
- package/dist/client/chunks/{chart-kpi-delta-DJKL02Ut.js.map → chart-kpi-delta-C2wKPqCb.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-CuNEYbRx.js → chart-kpi-number-gWYF44ol.js} +8 -8
- package/dist/client/chunks/{chart-kpi-number-CuNEYbRx.js.map → chart-kpi-number-gWYF44ol.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-u8FJaZDQ.js → chart-kpi-text-DIYtJtk4.js} +4 -4
- package/dist/client/chunks/{chart-kpi-text-u8FJaZDQ.js.map → chart-kpi-text-DIYtJtk4.js.map} +1 -1
- package/dist/client/chunks/{chart-line-BZhzOjRl.js → chart-line-9BEGN5Ti.js} +4 -4
- package/dist/client/chunks/{chart-line-BZhzOjRl.js.map → chart-line-9BEGN5Ti.js.map} +1 -1
- package/dist/client/chunks/chart-markdown-dgUetjyM.js +3654 -0
- package/dist/client/chunks/chart-markdown-dgUetjyM.js.map +1 -0
- package/dist/client/chunks/{chart-measure-profile-BnpIOS4Q.js → chart-measure-profile-ClfpLs4q.js} +4 -4
- package/dist/client/chunks/{chart-measure-profile-BnpIOS4Q.js.map → chart-measure-profile-ClfpLs4q.js.map} +1 -1
- package/dist/client/chunks/{chart-pie-CsdzxmSK.js → chart-pie-BjAIhyOi.js} +4 -4
- package/dist/client/chunks/{chart-pie-CsdzxmSK.js.map → chart-pie-BjAIhyOi.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-C_9RwMKw.js → chart-radar-Dgkcl2bN.js} +4 -4
- package/dist/client/chunks/{chart-radar-C_9RwMKw.js.map → chart-radar-Dgkcl2bN.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-CewRelyQ.js → chart-radial-bar-DdWJjAhK.js} +4 -4
- package/dist/client/chunks/{chart-radial-bar-CewRelyQ.js.map → chart-radial-bar-DdWJjAhK.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-ItraHWH1.js → chart-sankey-M3XpO_ah.js} +3 -3
- package/dist/client/chunks/{chart-sankey-ItraHWH1.js.map → chart-sankey-M3XpO_ah.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-k2IJbO2Y.js → chart-scatter-DaHYP_OL.js} +4 -4
- package/dist/client/chunks/{chart-scatter-k2IJbO2Y.js.map → chart-scatter-DaHYP_OL.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-NsFRuqi9.js → chart-sunburst-A_u6lqlS.js} +4 -4
- package/dist/client/chunks/{chart-sunburst-NsFRuqi9.js.map → chart-sunburst-A_u6lqlS.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-Cj_ewpwJ.js → chart-tree-map-uiwUU4nb.js} +4 -4
- package/dist/client/chunks/{chart-tree-map-Cj_ewpwJ.js.map → chart-tree-map-uiwUU4nb.js.map} +1 -1
- package/dist/client/chunks/{chart-waterfall-C-MTFcOz.js → chart-waterfall-BuhMoagf.js} +4 -4
- package/dist/client/chunks/{chart-waterfall-C-MTFcOz.js.map → chart-waterfall-BuhMoagf.js.map} +1 -1
- package/dist/client/chunks/{charts-core-vZA3zPKb.js → charts-core-jRtb0S2M.js} +2 -2
- package/dist/client/chunks/{charts-core-vZA3zPKb.js.map → charts-core-jRtb0S2M.js.map} +1 -1
- package/dist/client/chunks/{core-Su6tIYhp.js → core-D7vPfUIe.js} +84 -84
- package/dist/client/chunks/{core-Su6tIYhp.js.map → core-D7vPfUIe.js.map} +1 -1
- package/dist/client/chunks/{dist-BTq3NoG3.js → dist-zPWyTBdU.js} +1 -1
- package/dist/client/chunks/{dist-BTq3NoG3.js.map → dist-zPWyTBdU.js.map} +1 -1
- package/dist/client/chunks/{en-US-D-1JPTPv.js → en-US-BE6VoG0o.js} +1 -1
- package/dist/client/chunks/{en-US-D-1JPTPv.js.map → en-US-BE6VoG0o.js.map} +1 -1
- package/dist/client/chunks/{exceljs.min-Dc1cBQ5l.js → exceljs.min-CIqBqwTW.js} +2 -2
- package/dist/client/chunks/{exceljs.min-Dc1cBQ5l.js.map → exceljs.min-CIqBqwTW.js.map} +1 -1
- package/dist/client/chunks/{javascript-YXkoOgWa.js → javascript-DFnKaHmQ.js} +3 -3
- package/dist/client/chunks/{javascript-YXkoOgWa.js.map → javascript-DFnKaHmQ.js.map} +1 -1
- package/dist/client/chunks/{json-O7MKB_4V.js → json-Cu6rbgWf.js} +1 -1
- package/dist/client/chunks/{json-O7MKB_4V.js.map → json-Cu6rbgWf.js.map} +1 -1
- package/dist/client/chunks/{nl-NL-BErZMygi.js → nl-NL-CpVs7ox3.js} +7 -2
- package/dist/client/chunks/{nl-NL-BErZMygi.js.map → nl-NL-CpVs7ox3.js.map} +1 -1
- package/dist/client/chunks/{providers-DX3Vw5kc.js → providers-DwQCKdGW.js} +1 -1
- package/dist/client/chunks/{providers-DX3Vw5kc.js.map → providers-DwQCKdGW.js.map} +1 -1
- package/dist/client/chunks/{retention-YhT1Oohi.js → retention-ChW9jYdy.js} +1 -1
- package/dist/client/chunks/{retention-YhT1Oohi.js.map → retention-ChW9jYdy.js.map} +1 -1
- package/dist/client/chunks/{schema-visualization-BY9L2nBQ.js → schema-visualization-DE09kQE3.js} +5 -5
- package/dist/client/chunks/{schema-visualization-BY9L2nBQ.js.map → schema-visualization-DE09kQE3.js.map} +1 -1
- package/dist/client/chunks/{sql-r2a-9CCK.js → sql-CmVzGP4w.js} +1 -1
- package/dist/client/chunks/{sql-r2a-9CCK.js.map → sql-CmVzGP4w.js.map} +1 -1
- package/dist/client/chunks/{useDebounce-DGfYXtkm.js → useDirtyStateTracking-CoeQbprt.js} +99 -37
- package/dist/client/chunks/useDirtyStateTracking-CoeQbprt.js.map +1 -0
- package/dist/client/chunks/{useExplainAI-CD0KuKwY.js → useExplainAI-DlnXWdmz.js} +19 -19
- package/dist/client/chunks/{useExplainAI-CD0KuKwY.js.map → useExplainAI-DlnXWdmz.js.map} +1 -1
- package/dist/client/chunks/{useNotebookLayout-DKkMenhj.js → useNotebookLayout-Ck3Z3uzg.js} +2 -2
- package/dist/client/chunks/{useNotebookLayout-DKkMenhj.js.map → useNotebookLayout-Ck3Z3uzg.js.map} +1 -1
- package/dist/client/chunks/{utils-D2SCtAkZ.js → utils-CTKNaXS8.js} +40 -13
- package/dist/client/chunks/utils-CTKNaXS8.js.map +1 -0
- package/dist/client/chunks/{vendor-CfR5hJGc.js → vendor-CPIYyeuD.js} +102 -97
- package/dist/client/chunks/vendor-CPIYyeuD.js.map +1 -0
- package/dist/client/components/AnalysisBuilder/AnalysisAIPanel.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisAxisDropZone.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisChartConfigPanel.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisDisplayConfigPanel.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisFilterGroup.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisFilterItem.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisFilterSection.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisModeErrorBoundary.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/ExplainAIPanel.d.ts +2 -1
- package/dist/client/components/AnalysisBuilder/FieldDetailPanel.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/FieldSearchItem.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/FieldSearchModal.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/FilterConfigModal.d.ts +2 -1
- package/dist/client/components/AnalysisBuilder/LimitSection.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/SectionHeading.d.ts +1 -1
- package/dist/client/components/AnalyticsDashboard.d.ts +1 -1
- package/dist/client/components/AnalyticsPage.d.ts +1 -1
- package/dist/client/components/ChartErrorBoundary.d.ts +1 -1
- package/dist/client/components/ChartTypeSelector.d.ts +1 -1
- package/dist/client/components/ColorPaletteSelector.d.ts +1 -1
- package/dist/client/components/DashboardEditModal.d.ts +2 -1
- package/dist/client/components/DashboardFilters/DashboardFilterConfigModal.d.ts +1 -1
- package/dist/client/components/DashboardFilters/DashboardFilterItem.d.ts +1 -1
- package/dist/client/components/DashboardGrid.d.ts +3 -1
- package/dist/client/components/DashboardThumbnailPlaceholder.d.ts +1 -1
- package/dist/client/components/DataBrowser/DataBrowserSidebar.d.ts +1 -1
- package/dist/client/components/DataBrowser/DataBrowserToolbar.d.ts +1 -1
- package/dist/client/components/DataBrowser/index.d.ts +1 -1
- package/dist/client/components/DataHistogram.d.ts +1 -1
- package/dist/client/components/DebugModal.d.ts +1 -1
- package/dist/client/components/DrillBreadcrumb.d.ts +2 -1
- package/dist/client/components/LoadingIndicator.d.ts +1 -1
- package/dist/client/components/MobileStackedLayout.d.ts +1 -1
- package/dist/client/components/PortletAnalysisModal.d.ts +1 -1
- package/dist/client/components/PortletContainer.d.ts +1 -1
- package/dist/client/components/PortletFilterConfigModal.d.ts +6 -4
- package/dist/client/components/RowManagedLayout.d.ts +1 -1
- package/dist/client/components/ScaledGridWrapper.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/CubeNode.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/FieldDetailPanel.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/RelationshipEdge.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/SchemaVisualizationLazy.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/index.d.ts +1 -1
- package/dist/client/components/TextPortletModal.d.ts +1 -1
- package/dist/client/components/charts/AxisFormatControls.d.ts +2 -2
- package/dist/client/components/charts/ChartContainer.d.ts +1 -1
- package/dist/client/components/charts/ChartLegend.d.ts +1 -1
- package/dist/client/components/charts/ChartTooltip.d.ts +1 -1
- package/dist/client/components/charts/MissingDependencyFallback.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardContext.d.ts +113 -0
- package/dist/client/components/dashboard/DashboardCoordinator.d.ts +2 -0
- package/dist/client/components/dashboard/DashboardFilterBar.d.ts +8 -0
- package/dist/client/components/dashboard/DashboardGridSurface.d.ts +8 -0
- package/dist/client/components/dashboard/DashboardModals.d.ts +8 -0
- package/dist/client/components/dashboard/DashboardProvider.d.ts +2 -0
- package/dist/client/components/dashboard/DashboardToolbar.d.ts +11 -0
- package/dist/client/components/dashboard/dashboardGridUtils.d.ts +17 -0
- package/dist/client/components/dashboard/index.d.ts +13 -0
- package/dist/client/components.d.ts +2 -0
- package/dist/client/components.js +3 -4
- package/dist/client/hooks/dashboard/useDashboardController.d.ts +2 -2
- package/dist/client/hooks/useDashboardHook.d.ts +2 -2
- package/dist/client/hooks.js +5 -6
- package/dist/client/icons.d.ts +1 -1
- package/dist/client/icons.js +2 -2
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +161 -163
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers/CubeApiProvider.d.ts +1 -1
- package/dist/client/providers/CubeFeaturesProvider.d.ts +1 -1
- package/dist/client/providers/CubeMetaProvider.d.ts +1 -1
- package/dist/client/providers/CubeProvider.d.ts +1 -1
- package/dist/client/providers/I18nProvider.d.ts +1 -1
- package/dist/client/providers.js +3 -3
- package/dist/client/schema.js +1 -1
- package/dist/client/stores/analysisBuilderStore.d.ts +1 -1
- package/dist/client/stores/dashboardStore.d.ts +1 -1
- package/dist/client/stores/dataBrowserStore.d.ts +1 -1
- package/dist/client/stores/notebookStore.d.ts +1 -1
- package/dist/client/styles.css +1 -1
- package/dist/client/types/drill.d.ts +1 -1
- package/dist/client/types.d.ts +7 -2
- package/dist/client/utils/drillQueryBuilder.d.ts +2 -2
- package/dist/client/utils/filterUtils.d.ts +33 -5
- package/dist/client/utils/joinReachability.d.ts +27 -0
- package/dist/client/utils.js +6 -7
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +78 -52
- package/dist/{adapters/dist-Boc63-1q.cjs → server/dist-BOdf-GQO.cjs} +1 -1
- package/dist/{adapters/google-CT4kgmBf.js → server/google-CFYljAOF.js} +1 -1
- package/dist/server/{google-DzQWXFwF.cjs → google-DUlXeeDA.cjs} +1 -1
- package/dist/server/index.cjs +11 -11
- package/dist/server/index.d.ts +2 -5050
- package/dist/server/index.js +58 -15
- package/dist/{adapters/openai-CuUGrKaK.js → server/openai-B5jEiqiB.js} +2139 -948
- package/dist/{adapters/openai-DQawCWQb.js → server/openai-BZdAA7Ji.js} +1 -1
- package/dist/server/openai-D0musiYP.cjs +17 -0
- package/dist/server/{openai-BfiZU0rG.cjs → openai-D_U4V0kT.cjs} +1 -1
- package/dist/server/server/adapters/base-adapter.d.ts +287 -0
- package/dist/server/server/adapters/databend-adapter.d.ts +114 -0
- package/dist/server/server/adapters/duckdb-adapter.d.ts +122 -0
- package/dist/server/server/adapters/mysql-adapter.d.ts +122 -0
- package/dist/server/server/adapters/postgres-adapter.d.ts +119 -0
- package/dist/server/server/adapters/singlestore-adapter.d.ts +4 -0
- package/dist/server/server/adapters/snowflake-adapter.d.ts +116 -0
- package/dist/server/server/adapters/sqlite-adapter.d.ts +140 -0
- package/dist/server/server/agent/chart-validation.d.ts +27 -0
- package/dist/server/server/agent/handler.d.ts +25 -0
- package/dist/server/server/agent/index.d.ts +11 -0
- package/dist/server/server/agent/providers/anthropic.d.ts +24 -0
- package/dist/server/server/agent/providers/factory.d.ts +12 -0
- package/dist/server/server/agent/providers/google.d.ts +23 -0
- package/dist/server/server/agent/providers/index.d.ts +6 -0
- package/dist/server/server/agent/providers/openai.d.ts +26 -0
- package/dist/server/server/agent/providers/types.d.ts +95 -0
- package/dist/server/server/agent/system-prompt.d.ts +5 -0
- package/dist/server/server/agent/tools.d.ts +28 -0
- package/dist/server/server/agent/types.d.ts +192 -0
- package/dist/server/server/ai/discovery.d.ts +62 -0
- package/dist/server/server/ai/index.d.ts +10 -0
- package/dist/server/server/ai/mcp-prompts.d.ts +83 -0
- package/dist/server/server/ai/query-schema.d.ts +258 -0
- package/dist/server/server/ai/schemas.d.ts +63 -0
- package/dist/server/server/ai/suggestion.d.ts +19 -0
- package/dist/server/server/ai/validation.d.ts +34 -0
- package/dist/server/server/builders/comparison-query-builder.d.ts +70 -0
- package/dist/server/server/builders/cte-builder.d.ts +62 -0
- package/dist/server/server/builders/date-time-builder.d.ts +29 -0
- package/dist/server/server/builders/filter-builder.d.ts +23 -0
- package/dist/server/server/builders/flow-query-builder.d.ts +109 -0
- package/dist/server/server/builders/funnel-query-builder.d.ts +134 -0
- package/dist/server/server/builders/group-by-builder.d.ts +27 -0
- package/dist/server/server/builders/index.d.ts +13 -0
- package/dist/server/server/builders/measure-builder.d.ts +142 -0
- package/dist/server/server/builders/retention-query-builder.d.ts +100 -0
- package/dist/server/server/cache-providers/index.d.ts +5 -0
- package/dist/server/server/cache-providers/memory.d.ts +105 -0
- package/dist/server/server/cache-utils.d.ts +65 -0
- package/dist/server/server/compiler.d.ts +218 -0
- package/dist/server/server/cube-utils.d.ts +133 -0
- package/dist/server/server/database-utils.d.ts +18 -0
- package/dist/server/server/executor.d.ts +183 -0
- package/dist/server/server/executors/base-executor.d.ts +16 -0
- package/dist/server/server/executors/databend-executor.d.ts +33 -0
- package/dist/server/server/executors/duckdb-executor.d.ts +33 -0
- package/dist/server/server/executors/index.d.ts +21 -0
- package/dist/server/server/executors/mysql-executor.d.ts +27 -0
- package/dist/server/server/executors/postgres-executor.d.ts +27 -0
- package/dist/server/server/executors/singlestore-executor.d.ts +9 -0
- package/dist/server/server/executors/snowflake-executor.d.ts +33 -0
- package/dist/server/server/executors/sqlite-executor.d.ts +28 -0
- package/dist/server/server/explain/databend-parser.d.ts +16 -0
- package/dist/server/server/explain/duckdb-parser.d.ts +28 -0
- package/dist/server/server/explain/index.d.ts +9 -0
- package/dist/server/server/explain/mysql-parser.d.ts +38 -0
- package/dist/server/server/explain/postgres-parser.d.ts +18 -0
- package/dist/server/server/explain/snowflake-parser.d.ts +17 -0
- package/dist/server/server/explain/sqlite-parser.d.ts +23 -0
- package/dist/server/server/filter-cache.d.ts +73 -0
- package/dist/server/server/gap-filler.d.ts +42 -0
- package/dist/server/server/index.d.ts +36 -0
- package/dist/server/server/logical-plan/index.d.ts +14 -0
- package/dist/server/server/logical-plan/logical-plan-builder.d.ts +58 -0
- package/dist/server/server/logical-plan/logical-planner.d.ts +232 -0
- package/dist/server/server/logical-plan/optimiser.d.ts +32 -0
- package/dist/server/server/logical-plan/types.d.ts +191 -0
- package/dist/server/server/physical-plan/drizzle-plan-builder.d.ts +50 -0
- package/dist/server/server/physical-plan/drizzle-sql-builder.d.ts +107 -0
- package/dist/server/server/physical-plan/index.d.ts +2 -0
- package/dist/server/server/physical-plan/processors/cte-processor.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/index.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/joins-processor.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/predicates-processor.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/selection-processor.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/shared.d.ts +33 -0
- package/dist/server/server/physical-plan/processors/window-processor.d.ts +6 -0
- package/dist/server/server/prompts/explain-analysis-prompt.d.ts +47 -0
- package/dist/server/server/prompts/index.d.ts +27 -0
- package/dist/server/server/prompts/single-step-prompt.d.ts +31 -0
- package/dist/server/server/prompts/step0-validation-prompt.d.ts +39 -0
- package/dist/server/server/prompts/step1-shape-prompt.d.ts +29 -0
- package/dist/server/server/prompts/step2-complete-prompt.d.ts +19 -0
- package/dist/server/server/prompts/types.d.ts +37 -0
- package/dist/server/server/resolvers/calculated-measure-resolver.d.ts +93 -0
- package/dist/server/server/resolvers/index.d.ts +6 -0
- package/dist/server/server/resolvers/join-path-resolver.d.ts +152 -0
- package/dist/server/server/template-substitution.d.ts +57 -0
- package/dist/server/server/types/analysis.d.ts +189 -0
- package/dist/server/server/types/cache.d.ts +132 -0
- package/dist/server/server/types/core.d.ts +164 -0
- package/dist/server/server/types/cube.d.ts +530 -0
- package/dist/server/server/types/executor.d.ts +156 -0
- package/dist/server/server/types/flow.d.ts +143 -0
- package/dist/server/server/types/funnel.d.ts +118 -0
- package/dist/server/server/types/index.d.ts +11 -0
- package/dist/server/server/types/metadata.d.ts +113 -0
- package/dist/server/server/types/query.d.ts +153 -0
- package/dist/server/server/types/retention.d.ts +141 -0
- package/dist/server/server/types/utils.d.ts +11 -0
- package/package.json +6 -6
- package/dist/adapters/mcp-transport-BCtjU0lC.cjs +0 -40
- package/dist/adapters/mcp-transport-DW_Uks-O.js +0 -579
- package/dist/adapters/openai-Bgri5TJc.cjs +0 -16
- package/dist/client/chunks/DashboardEditModal-BiJwVv0b.js +0 -6696
- package/dist/client/chunks/DashboardEditModal-BiJwVv0b.js.map +0 -1
- package/dist/client/chunks/FieldSearchModal-DdcbCwAi.js +0 -2660
- package/dist/client/chunks/FieldSearchModal-DdcbCwAi.js.map +0 -1
- package/dist/client/chunks/chart-data-table-DT4uBZaq.js.map +0 -1
- package/dist/client/chunks/chart-markdown-DEtjn8gx.js +0 -3539
- package/dist/client/chunks/chart-markdown-DEtjn8gx.js.map +0 -1
- package/dist/client/chunks/syntaxHighlighting-5zHcjn27.js +0 -30
- package/dist/client/chunks/syntaxHighlighting-5zHcjn27.js.map +0 -1
- package/dist/client/chunks/useDebounce-DGfYXtkm.js.map +0 -1
- package/dist/client/chunks/useDirtyStateTracking-KAjwj1Ht.js +0 -66
- package/dist/client/chunks/useDirtyStateTracking-KAjwj1Ht.js.map +0 -1
- package/dist/client/chunks/utils-D2SCtAkZ.js.map +0 -1
- package/dist/client/chunks/vendor-CfR5hJGc.js.map +0 -1
- package/dist/server/openai-BwsBio1K.cjs +0 -16
- /package/dist/adapters/{express → adapters/express}/index.d.ts +0 -0
- /package/dist/adapters/{fastify → adapters/fastify}/index.d.ts +0 -0
- /package/dist/adapters/{hono → adapters/hono}/index.d.ts +0 -0
- /package/dist/adapters/{locale.d.ts → adapters/locale.d.ts} +0 -0
- /package/dist/adapters/{mcp-tools.d.ts → adapters/mcp-tools.d.ts} +0 -0
- /package/dist/adapters/{mcp-transport.d.ts → adapters/mcp-transport.d.ts} +0 -0
- /package/dist/adapters/{nextjs → adapters/nextjs}/index.d.ts +0 -0
- /package/dist/adapters/{types.d.ts → adapters/types.d.ts} +0 -0
- /package/dist/adapters/{utils.d.ts → adapters/utils.d.ts} +0 -0
- /package/dist/adapters/{anthropic-B_rg0BhK.js → anthropic-CZh4hB-m.js} +0 -0
- /package/dist/adapters/{anthropic-BIva8k1r.cjs → anthropic-DG4r1LSm.cjs} +0 -0
- /package/dist/adapters/{dist-De5fzUEM.js → dist-CH3hwAUk.js} +0 -0
- /package/dist/client/chunks/{rolldown-runtime-CKnJJeip.js → rolldown-runtime-CWhphoD1.js} +0 -0
- /package/dist/server/{anthropic-BsNspi1r.js → anthropic-CZh4hB-m.js} +0 -0
- /package/dist/server/{anthropic-DsCEX6Fm.cjs → anthropic-DG4r1LSm.cjs} +0 -0
- /package/dist/server/{dist-CMWZC51B.js → dist-CH3hwAUk.js} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic query schemas for AI agents
|
|
3
|
+
* Teaches AI how to construct analysis queries
|
|
4
|
+
*
|
|
5
|
+
* These schemas are returned by the `discover` tool to help LLMs
|
|
6
|
+
* understand the correct query shape for each analysis mode.
|
|
7
|
+
*/
|
|
8
|
+
export declare const QUERY_SCHEMAS: {
|
|
9
|
+
readonly funnel: {
|
|
10
|
+
readonly description: "Track conversion through sequential steps. Entities (identified by bindingKey) move through ordered steps.";
|
|
11
|
+
readonly structure: {
|
|
12
|
+
readonly funnel: {
|
|
13
|
+
readonly bindingKey: "Cube.dimension - identifies entities moving through funnel";
|
|
14
|
+
readonly timeDimension: "Cube.dimension - time field for ordering events";
|
|
15
|
+
readonly steps: readonly [{
|
|
16
|
+
readonly name: "string - human readable step name";
|
|
17
|
+
readonly filter: "{ member, operator, values } or array of filters. Put inDateRange ONLY on step 0.";
|
|
18
|
+
readonly timeToConvert: "optional - ISO 8601 duration e.g. \"P7D\" for 7 days, \"PT1H\" for 1 hour";
|
|
19
|
+
}];
|
|
20
|
+
readonly includeTimeMetrics: "optional boolean - include avg/median/p90 time-to-convert";
|
|
21
|
+
readonly globalTimeWindow: "optional - ISO 8601 duration, all steps must complete within this window";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
readonly flow: {
|
|
26
|
+
readonly description: "Analyze paths users take before/after a specific event. Shows event sequences as Sankey/sunburst.";
|
|
27
|
+
readonly structure: {
|
|
28
|
+
readonly flow: {
|
|
29
|
+
readonly bindingKey: "Cube.dimension - identifies entities";
|
|
30
|
+
readonly timeDimension: "Cube.dimension - time field for ordering";
|
|
31
|
+
readonly eventDimension: "Cube.dimension - the event type field (values become node labels)";
|
|
32
|
+
readonly startingStep: {
|
|
33
|
+
readonly name: "string - display name for the starting step";
|
|
34
|
+
readonly filter: "{ member, operator, values } - filter identifying the starting event";
|
|
35
|
+
};
|
|
36
|
+
readonly stepsBefore: "number (0-5) - how many steps to show before starting step";
|
|
37
|
+
readonly stepsAfter: "number (0-5) - how many steps to show after starting step";
|
|
38
|
+
readonly entityLimit: "optional number - max entities to process (performance)";
|
|
39
|
+
readonly outputMode: "optional \"sankey\" | \"sunburst\" (default: sankey)";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly retention: {
|
|
44
|
+
readonly description: "Measure how many users return over time periods after initial activity.";
|
|
45
|
+
readonly structure: {
|
|
46
|
+
readonly retention: {
|
|
47
|
+
readonly timeDimension: "Cube.dimension - time field for cohort assignment";
|
|
48
|
+
readonly bindingKey: "Cube.dimension - identifies entities";
|
|
49
|
+
readonly dateRange: {
|
|
50
|
+
readonly start: "YYYY-MM-DD - cohort start date";
|
|
51
|
+
readonly end: "YYYY-MM-DD - cohort end date";
|
|
52
|
+
};
|
|
53
|
+
readonly granularity: "day | week | month - period size";
|
|
54
|
+
readonly periods: "number - how many periods to analyze";
|
|
55
|
+
readonly retentionType: "\"classic\" (returned in period N) | \"rolling\" (returned in N or later)";
|
|
56
|
+
readonly cohortFilters: "optional - filters on cohort entry events";
|
|
57
|
+
readonly activityFilters: "optional - filters on return activity events";
|
|
58
|
+
readonly breakdownDimensions: "optional string[] - segment by these dimensions";
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export type QuerySchemas = typeof QUERY_SCHEMAS;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CubeMetadata } from '../types/metadata';
|
|
2
|
+
import { SemanticQuery } from '../types/query';
|
|
3
|
+
/**
|
|
4
|
+
* Suggested query result
|
|
5
|
+
*/
|
|
6
|
+
export interface QuerySuggestion {
|
|
7
|
+
query: Partial<SemanticQuery>;
|
|
8
|
+
confidence: number;
|
|
9
|
+
reasoning: string[];
|
|
10
|
+
warnings?: string[];
|
|
11
|
+
/** Detected analysis mode */
|
|
12
|
+
analysisMode: 'query' | 'funnel' | 'flow' | 'retention';
|
|
13
|
+
/** Next steps when mode != 'query' */
|
|
14
|
+
nextSteps?: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Suggest a query based on natural language input
|
|
18
|
+
*/
|
|
19
|
+
export declare function suggestQuery(metadata: CubeMetadata[], naturalLanguage: string, targetCube?: string): QuerySuggestion;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CubeMetadata } from '../types/metadata';
|
|
2
|
+
import { SemanticQuery } from '../types/query';
|
|
3
|
+
/**
|
|
4
|
+
* Validation result with corrections
|
|
5
|
+
*/
|
|
6
|
+
export interface ValidationResult {
|
|
7
|
+
isValid: boolean;
|
|
8
|
+
errors: ValidationError[];
|
|
9
|
+
warnings: ValidationWarning[];
|
|
10
|
+
correctedQuery?: SemanticQuery;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Validation error with optional correction
|
|
14
|
+
*/
|
|
15
|
+
export interface ValidationError {
|
|
16
|
+
type: 'cube_not_found' | 'measure_not_found' | 'dimension_not_found' | 'invalid_filter' | 'invalid_time_dimension' | 'syntax_error';
|
|
17
|
+
message: string;
|
|
18
|
+
field?: string;
|
|
19
|
+
suggestion?: string;
|
|
20
|
+
correctedValue?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Validation warning (query will work but may have issues)
|
|
24
|
+
*/
|
|
25
|
+
export interface ValidationWarning {
|
|
26
|
+
type: 'ambiguous_field' | 'performance' | 'best_practice';
|
|
27
|
+
message: string;
|
|
28
|
+
field?: string;
|
|
29
|
+
suggestion?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Validate a query with helpful corrections
|
|
33
|
+
*/
|
|
34
|
+
export declare function validateQuery(query: SemanticQuery, metadata: CubeMetadata[]): ValidationResult;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { SemanticQuery, TimeDimension, QueryResult, TimeGranularity } from '../types';
|
|
2
|
+
import { DatabaseAdapter } from '../adapters/base-adapter';
|
|
3
|
+
/**
|
|
4
|
+
* Normalized period range with start/end dates and metadata
|
|
5
|
+
*/
|
|
6
|
+
export interface NormalizedPeriod {
|
|
7
|
+
/** Start date of the period */
|
|
8
|
+
start: Date;
|
|
9
|
+
/** End date of the period */
|
|
10
|
+
end: Date;
|
|
11
|
+
/** Human-readable label for the period */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Index in the comparison (0 = first/current, 1 = second/prior, etc.) */
|
|
14
|
+
index: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extended result row with period metadata for alignment
|
|
18
|
+
*/
|
|
19
|
+
export interface ComparisonResultRow extends Record<string, unknown> {
|
|
20
|
+
/** Period label (e.g., "2024-01-01 - 2024-01-31") */
|
|
21
|
+
__period: string;
|
|
22
|
+
/** Period index (0 = current, 1 = prior, etc.) */
|
|
23
|
+
__periodIndex: number;
|
|
24
|
+
/** Day-of-period index for alignment in overlay mode */
|
|
25
|
+
__periodDayIndex: number;
|
|
26
|
+
}
|
|
27
|
+
export declare class ComparisonQueryBuilder {
|
|
28
|
+
private dateTimeBuilder;
|
|
29
|
+
constructor(databaseAdapter: DatabaseAdapter);
|
|
30
|
+
/**
|
|
31
|
+
* Check if a query contains compareDateRange
|
|
32
|
+
*/
|
|
33
|
+
hasComparison(query: SemanticQuery): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Get the time dimension with compareDateRange
|
|
36
|
+
*/
|
|
37
|
+
getComparisonTimeDimension(query: SemanticQuery): TimeDimension | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Normalize compareDateRange entries to concrete date ranges
|
|
40
|
+
* Handles both relative strings ('last 30 days') and explicit arrays (['2024-01-01', '2024-01-31'])
|
|
41
|
+
*/
|
|
42
|
+
normalizePeriods(compareDateRange: (string | [string, string])[]): NormalizedPeriod[];
|
|
43
|
+
/**
|
|
44
|
+
* Create sub-query for a specific period
|
|
45
|
+
* Replaces compareDateRange with a concrete dateRange for that period
|
|
46
|
+
*/
|
|
47
|
+
createPeriodQuery(query: SemanticQuery, period: NormalizedPeriod): SemanticQuery;
|
|
48
|
+
/**
|
|
49
|
+
* Calculate the day-of-period index for a date
|
|
50
|
+
* Used for aligning data points across periods in overlay mode
|
|
51
|
+
*/
|
|
52
|
+
calculatePeriodDayIndex(date: Date | string, periodStart: Date, granularity: TimeGranularity): number;
|
|
53
|
+
/**
|
|
54
|
+
* Add period metadata to result rows
|
|
55
|
+
*/
|
|
56
|
+
addPeriodMetadata(data: Record<string, unknown>[], period: NormalizedPeriod, timeDimensionKey: string, granularity: TimeGranularity): ComparisonResultRow[];
|
|
57
|
+
/**
|
|
58
|
+
* Merge results from multiple period queries
|
|
59
|
+
* Adds period metadata and creates combined result with annotation
|
|
60
|
+
*/
|
|
61
|
+
mergeComparisonResults(periodResults: Array<{
|
|
62
|
+
result: QueryResult;
|
|
63
|
+
period: NormalizedPeriod;
|
|
64
|
+
}>, timeDimension: TimeDimension, granularity: TimeGranularity): QueryResult;
|
|
65
|
+
/**
|
|
66
|
+
* Sort merged results by period index and then by time dimension
|
|
67
|
+
* Ensures consistent ordering for client-side processing
|
|
68
|
+
*/
|
|
69
|
+
sortComparisonResults(data: ComparisonResultRow[], timeDimensionKey: string): ComparisonResultRow[];
|
|
70
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
import { SemanticQuery, QueryContext, PhysicalQueryPlan, PropagatingFilter } from '../types';
|
|
3
|
+
import { DrizzleSqlBuilder } from '../physical-plan/drizzle-sql-builder';
|
|
4
|
+
/**
|
|
5
|
+
* CTE information type extracted from runtime physical plan context
|
|
6
|
+
*/
|
|
7
|
+
export type CTEInfo = NonNullable<PhysicalQueryPlan['preAggregationCTEs']>[0];
|
|
8
|
+
/**
|
|
9
|
+
* CTEBuilder handles the construction of Common Table Expressions
|
|
10
|
+
* for pre-aggregation in hasMany relationship queries.
|
|
11
|
+
*
|
|
12
|
+
* This enables efficient aggregation of "many" side data before joining,
|
|
13
|
+
* preventing the Cartesian product explosion that would occur with direct JOINs.
|
|
14
|
+
*/
|
|
15
|
+
export declare class CTEBuilder {
|
|
16
|
+
private queryBuilder;
|
|
17
|
+
constructor(queryBuilder: DrizzleSqlBuilder);
|
|
18
|
+
/**
|
|
19
|
+
* Build pre-aggregation CTE for hasMany relationships
|
|
20
|
+
*
|
|
21
|
+
* Creates a CTE that:
|
|
22
|
+
* 1. Selects join keys and aggregated measures
|
|
23
|
+
* 2. Applies security context filtering
|
|
24
|
+
* 3. Groups by join keys and requested dimensions
|
|
25
|
+
* 4. Handles propagating filters from related cubes
|
|
26
|
+
* 5. Handles multi-hop join paths by absorbing intermediate tables (fan-out prevention)
|
|
27
|
+
*/
|
|
28
|
+
buildPreAggregationCTE(cteInfo: CTEInfo, query: SemanticQuery, context: QueryContext, queryPlan: PhysicalQueryPlan, preBuiltFilterMap?: Map<string, SQL[]>): any;
|
|
29
|
+
/**
|
|
30
|
+
* Build join condition for CTE
|
|
31
|
+
*
|
|
32
|
+
* Creates the ON clause for joining a CTE to the main query.
|
|
33
|
+
* Uses stored column objects for type-safe joins.
|
|
34
|
+
*
|
|
35
|
+
* For multi-hop paths with intermediate joins:
|
|
36
|
+
* - The CTE includes columns from intermediate tables
|
|
37
|
+
* - The join condition uses the intermediate's primary-connected column
|
|
38
|
+
* - Example: departments.id = employeeteams_agg.department_id (not employee_id!)
|
|
39
|
+
*/
|
|
40
|
+
buildCTEJoinCondition(joinCube: PhysicalQueryPlan['joinCubes'][0], cteAlias: string, queryPlan: PhysicalQueryPlan): SQL;
|
|
41
|
+
/**
|
|
42
|
+
* Resolve source-side join expression for CTE joins.
|
|
43
|
+
*
|
|
44
|
+
* When two cubes are both materialized as CTEs in the same query, join keys can
|
|
45
|
+
* still point to the original table column object (e.g. departments.id). In that
|
|
46
|
+
* case the table is no longer present in FROM/JOIN, so rewrite to the upstream CTE
|
|
47
|
+
* alias column (e.g. departments_agg.id).
|
|
48
|
+
*/
|
|
49
|
+
private resolveCTEJoinSourceColumn;
|
|
50
|
+
/**
|
|
51
|
+
* Build a subquery filter for propagating filters from related cubes.
|
|
52
|
+
*
|
|
53
|
+
* This generates: cteCube.FK IN (SELECT sourceCube.PK FROM sourceCube WHERE filters...)
|
|
54
|
+
*
|
|
55
|
+
* Example: For Productivity CTE with Employees.createdAt filter:
|
|
56
|
+
* employee_id IN (SELECT id FROM employees WHERE organisation_id = $1 AND created_at >= $date)
|
|
57
|
+
*
|
|
58
|
+
* For composite keys, uses EXISTS instead of IN for better database compatibility:
|
|
59
|
+
* EXISTS (SELECT 1 FROM source WHERE source.pk1 = cte.fk1 AND source.pk2 = cte.fk2 AND <filters>)
|
|
60
|
+
*/
|
|
61
|
+
buildPropagatingFilterSubquery(propFilter: PropagatingFilter, context: QueryContext): SQL | null;
|
|
62
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SQL, AnyColumn } from 'drizzle-orm';
|
|
2
|
+
import { QueryContext } from '../types';
|
|
3
|
+
import { DatabaseAdapter } from '../adapters/base-adapter';
|
|
4
|
+
export declare class DateTimeBuilder {
|
|
5
|
+
private databaseAdapter;
|
|
6
|
+
constructor(databaseAdapter: DatabaseAdapter);
|
|
7
|
+
/**
|
|
8
|
+
* Build time dimension expression with granularity using database adapter
|
|
9
|
+
*/
|
|
10
|
+
buildTimeDimensionExpression(dimensionSql: any, granularity: string | undefined, context: QueryContext): SQL;
|
|
11
|
+
/**
|
|
12
|
+
* Build date range condition for time dimensions
|
|
13
|
+
*/
|
|
14
|
+
buildDateRangeCondition(fieldExpr: AnyColumn | SQL, dateRange: string | string[]): SQL | null;
|
|
15
|
+
/**
|
|
16
|
+
* Parse relative date range expressions like "today", "yesterday", "last 7 days", "this month", etc.
|
|
17
|
+
* Handles all 14 DATE_RANGE_OPTIONS from the client
|
|
18
|
+
*/
|
|
19
|
+
parseRelativeDateRange(dateRange: string): {
|
|
20
|
+
start: Date;
|
|
21
|
+
end: Date;
|
|
22
|
+
} | null;
|
|
23
|
+
/**
|
|
24
|
+
* Normalize date values to handle strings, numbers, and Date objects
|
|
25
|
+
* Returns ISO string for PostgreSQL/MySQL, Unix timestamp for SQLite, or null
|
|
26
|
+
* Ensures dates are in the correct format for each database engine
|
|
27
|
+
*/
|
|
28
|
+
normalizeDate(value: any): string | number | null;
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SQL, AnyColumn } from 'drizzle-orm';
|
|
2
|
+
import { FilterOperator, Filter, Cube, QueryContext } from '../types';
|
|
3
|
+
import { DatabaseAdapter } from '../adapters/base-adapter';
|
|
4
|
+
import { DateTimeBuilder } from './date-time-builder';
|
|
5
|
+
export declare class FilterBuilder {
|
|
6
|
+
private databaseAdapter;
|
|
7
|
+
private dateTimeBuilder;
|
|
8
|
+
constructor(databaseAdapter: DatabaseAdapter, dateTimeBuilder: DateTimeBuilder);
|
|
9
|
+
/**
|
|
10
|
+
* Build filter condition using Drizzle operators
|
|
11
|
+
*/
|
|
12
|
+
buildFilterCondition(fieldExpr: AnyColumn | SQL, operator: FilterOperator, values: any[], field?: any, dateRange?: string | string[]): SQL | null;
|
|
13
|
+
/**
|
|
14
|
+
* Build a logical filter (AND/OR) - used by executor for cache preloading
|
|
15
|
+
* This handles nested filter structures and builds combined SQL
|
|
16
|
+
*/
|
|
17
|
+
buildLogicalFilter(filter: Filter, cubes: Map<string, Cube>, context: QueryContext): SQL | null;
|
|
18
|
+
/**
|
|
19
|
+
* Build SQL for a single filter condition (simple or logical)
|
|
20
|
+
* Used for cache preloading to build filters independently of query context
|
|
21
|
+
*/
|
|
22
|
+
buildSingleFilter(filter: Filter, cubes: Map<string, Cube>, context: QueryContext): SQL | null;
|
|
23
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { DatabaseAdapter } from '../adapters/base-adapter';
|
|
2
|
+
import { FlowQueryConfig, FlowResultRow, FlowValidationResult } from '../types/flow';
|
|
3
|
+
import { Cube, QueryContext, SemanticQuery } from '../types';
|
|
4
|
+
export declare class FlowQueryBuilder {
|
|
5
|
+
private filterBuilder;
|
|
6
|
+
private dateTimeBuilder;
|
|
7
|
+
private databaseAdapter;
|
|
8
|
+
constructor(databaseAdapter: DatabaseAdapter);
|
|
9
|
+
/**
|
|
10
|
+
* Check if query contains flow configuration
|
|
11
|
+
*/
|
|
12
|
+
hasFlow(query: SemanticQuery): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Validate flow configuration
|
|
15
|
+
*/
|
|
16
|
+
validateConfig(config: FlowQueryConfig, cubes: Map<string, Cube>): FlowValidationResult;
|
|
17
|
+
/**
|
|
18
|
+
* Build complete flow query using Drizzle's query builder pattern
|
|
19
|
+
*
|
|
20
|
+
* Creates a series of CTEs to:
|
|
21
|
+
* 1. Find entities at the starting step
|
|
22
|
+
* 2. Walk backwards N steps to find preceding events
|
|
23
|
+
* 3. Walk forwards N steps to find following events
|
|
24
|
+
* 4. Aggregate into nodes and links for Sankey visualization
|
|
25
|
+
*/
|
|
26
|
+
buildFlowQuery(config: FlowQueryConfig, cubes: Map<string, Cube>, context: QueryContext): ReturnType<typeof context.db.select>;
|
|
27
|
+
/**
|
|
28
|
+
* Transform raw SQL result to FlowResultRow
|
|
29
|
+
* The raw result contains rows with record_type = 'node' or 'link'
|
|
30
|
+
*/
|
|
31
|
+
transformResult(rawResult: Record<string, unknown>[]): FlowResultRow;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve flow configuration to SQL expressions
|
|
34
|
+
*/
|
|
35
|
+
private resolveFlowConfig;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the cube for flow analysis
|
|
38
|
+
*/
|
|
39
|
+
private resolveCube;
|
|
40
|
+
/**
|
|
41
|
+
* Resolve binding key expression
|
|
42
|
+
*/
|
|
43
|
+
private resolveBindingKey;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve time dimension expression
|
|
46
|
+
*/
|
|
47
|
+
private resolveTimeDimension;
|
|
48
|
+
/**
|
|
49
|
+
* Resolve event dimension expression
|
|
50
|
+
*/
|
|
51
|
+
private resolveEventDimension;
|
|
52
|
+
/**
|
|
53
|
+
* Build filter conditions for the starting step
|
|
54
|
+
*/
|
|
55
|
+
private buildStartingStepFilters;
|
|
56
|
+
/**
|
|
57
|
+
* Build a single filter condition
|
|
58
|
+
*/
|
|
59
|
+
private buildFilterCondition;
|
|
60
|
+
/**
|
|
61
|
+
* Build the starting entities CTE
|
|
62
|
+
* Finds all entities matching the starting step filter with their start time and event type
|
|
63
|
+
* For sunburst mode, also initializes event_path with the starting event type
|
|
64
|
+
*/
|
|
65
|
+
private buildStartingEntitiesCTE;
|
|
66
|
+
/**
|
|
67
|
+
* Build CTEs for steps BEFORE the starting point using LATERAL joins
|
|
68
|
+
* Uses ORDER BY ... DESC LIMIT 1 to fetch immediate predecessor via index
|
|
69
|
+
*/
|
|
70
|
+
private buildBeforeCTEsLateral;
|
|
71
|
+
/**
|
|
72
|
+
* Build CTEs for steps AFTER the starting point using LATERAL joins
|
|
73
|
+
* Uses ORDER BY ... ASC LIMIT 1 to fetch immediate successor via index
|
|
74
|
+
*/
|
|
75
|
+
private buildAfterCTEsLateral;
|
|
76
|
+
/**
|
|
77
|
+
* Build CTEs for steps BEFORE the starting point
|
|
78
|
+
* Each CTE finds the immediate predecessor event for entities from the previous CTE
|
|
79
|
+
*
|
|
80
|
+
* Uses ROW_NUMBER() window function to get exactly the Nth previous event
|
|
81
|
+
* For sunburst mode, accumulates event_path by prepending to previous path
|
|
82
|
+
*/
|
|
83
|
+
private buildBeforeCTEsWindow;
|
|
84
|
+
/**
|
|
85
|
+
* Build CTEs for steps AFTER the starting point
|
|
86
|
+
* Each CTE finds the immediate successor event for entities from the previous CTE
|
|
87
|
+
*
|
|
88
|
+
* Uses ROW_NUMBER() window function to get exactly the Nth following event
|
|
89
|
+
* For sunburst mode, accumulates event_path by concatenating with previous path
|
|
90
|
+
*/
|
|
91
|
+
private buildAfterCTEsWindow;
|
|
92
|
+
/**
|
|
93
|
+
* Build the nodes aggregation CTE
|
|
94
|
+
* Aggregates counts per (layer, event_type) combination using UNION ALL
|
|
95
|
+
* For sunburst mode, aggregates by event_path for unique tree branches
|
|
96
|
+
*/
|
|
97
|
+
private buildNodesAggregationCTE;
|
|
98
|
+
/**
|
|
99
|
+
* Build the links aggregation CTE
|
|
100
|
+
* Counts transitions between adjacent layers
|
|
101
|
+
* For sunburst mode, uses event_path for unique branch identification
|
|
102
|
+
*/
|
|
103
|
+
private buildLinksAggregationCTE;
|
|
104
|
+
/**
|
|
105
|
+
* Build the final result CTE
|
|
106
|
+
* Combines nodes and links into a single result set with record_type discriminator
|
|
107
|
+
*/
|
|
108
|
+
private buildFinalResultCTE;
|
|
109
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { DatabaseAdapter } from '../adapters/base-adapter';
|
|
2
|
+
import { FunnelQueryConfig, FunnelResultRow } from '../types/funnel';
|
|
3
|
+
import { Cube, QueryContext, SemanticQuery } from '../types';
|
|
4
|
+
export declare class FunnelQueryBuilder {
|
|
5
|
+
private databaseAdapter;
|
|
6
|
+
private filterBuilder;
|
|
7
|
+
private dateTimeBuilder;
|
|
8
|
+
constructor(databaseAdapter: DatabaseAdapter);
|
|
9
|
+
/**
|
|
10
|
+
* Check if query contains funnel configuration
|
|
11
|
+
*/
|
|
12
|
+
hasFunnel(query: SemanticQuery): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Validate funnel configuration
|
|
15
|
+
*/
|
|
16
|
+
validateConfig(config: FunnelQueryConfig, cubes: Map<string, Cube>): {
|
|
17
|
+
isValid: boolean;
|
|
18
|
+
errors: string[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Build complete funnel query using Drizzle's query builder pattern
|
|
22
|
+
*
|
|
23
|
+
* Uses the industry-standard "sequential CTEs" pattern where each step
|
|
24
|
+
* joins to the previous step CTE. This automatically enforces funnel
|
|
25
|
+
* constraints (monotonically decreasing counts).
|
|
26
|
+
*
|
|
27
|
+
* Returns a Drizzle query builder that supports .toSQL() for dry-run
|
|
28
|
+
* and can be executed directly for results.
|
|
29
|
+
*/
|
|
30
|
+
buildFunnelQuery(config: FunnelQueryConfig, cubes: Map<string, Cube>, context: QueryContext): ReturnType<typeof context.db.select>;
|
|
31
|
+
/**
|
|
32
|
+
* Transform raw SQL result to FunnelResultRow[]
|
|
33
|
+
*/
|
|
34
|
+
transformResult(rawResult: Record<string, unknown>[], config: FunnelQueryConfig): FunnelResultRow[];
|
|
35
|
+
/**
|
|
36
|
+
* Extract cube names referenced in step filters
|
|
37
|
+
*/
|
|
38
|
+
private extractFilterCubeNames;
|
|
39
|
+
/**
|
|
40
|
+
* Resolve steps with their cube, SQL expressions, and filter conditions
|
|
41
|
+
*/
|
|
42
|
+
private resolveSteps;
|
|
43
|
+
/**
|
|
44
|
+
* Resolve the cube for a step
|
|
45
|
+
*/
|
|
46
|
+
private resolveCubeForStep;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve binding key expression for a cube
|
|
49
|
+
*/
|
|
50
|
+
private resolveBindingKey;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve time dimension expression for a cube
|
|
53
|
+
*/
|
|
54
|
+
private resolveTimeDimension;
|
|
55
|
+
/**
|
|
56
|
+
* Build filter conditions for a step
|
|
57
|
+
* @param step - The funnel step
|
|
58
|
+
* @param baseCube - The step's primary cube
|
|
59
|
+
* @param cubes - All cubes available for cross-cube filtering
|
|
60
|
+
* @param context - Query context with security context
|
|
61
|
+
*/
|
|
62
|
+
private buildStepFilters;
|
|
63
|
+
/**
|
|
64
|
+
* Build a single filter condition
|
|
65
|
+
* @param filter - The filter to build
|
|
66
|
+
* @param baseCube - The step's primary cube
|
|
67
|
+
* @param cubes - All cubes available for cross-cube filtering
|
|
68
|
+
* @param context - Query context with security context
|
|
69
|
+
*/
|
|
70
|
+
private buildFilterCondition;
|
|
71
|
+
/**
|
|
72
|
+
* Build CTE for a single step using Drizzle's $with() pattern
|
|
73
|
+
*
|
|
74
|
+
* For step 0 (entry point): queries raw data directly
|
|
75
|
+
* For subsequent steps: joins to the previous step CTE to enforce sequential progression
|
|
76
|
+
*
|
|
77
|
+
* This implements the industry-standard "sequential CTEs" pattern where each step
|
|
78
|
+
* only includes binding_keys that successfully completed the previous step.
|
|
79
|
+
*
|
|
80
|
+
* @param step - The resolved step configuration
|
|
81
|
+
* @param context - Query context with security context
|
|
82
|
+
* @param previousStepCTE - Reference to the previous step's CTE (undefined for step 0)
|
|
83
|
+
*/
|
|
84
|
+
private buildStepCTE;
|
|
85
|
+
/**
|
|
86
|
+
* Build CTE for the first step (step 0) - entry point
|
|
87
|
+
*
|
|
88
|
+
* Queries raw data directly with security context and step filters.
|
|
89
|
+
* Gets the first occurrence per binding key.
|
|
90
|
+
*/
|
|
91
|
+
private buildFirstStepCTE;
|
|
92
|
+
/**
|
|
93
|
+
* Build CTE for subsequent steps (step 1+) - joins to previous step
|
|
94
|
+
*
|
|
95
|
+
* This is the key to the sequential funnel pattern:
|
|
96
|
+
* - INNER JOINs to the previous step CTE (only includes binding_keys that completed previous step)
|
|
97
|
+
* - Applies temporal constraints (must occur after previous step)
|
|
98
|
+
* - Applies step-specific filters and time-to-convert windows
|
|
99
|
+
*
|
|
100
|
+
* This automatically ensures monotonically decreasing counts.
|
|
101
|
+
*/
|
|
102
|
+
private buildSubsequentStepCTE;
|
|
103
|
+
/**
|
|
104
|
+
* Helper to add cross-cube JOINs to a step query
|
|
105
|
+
* Extracted to avoid duplication between first and subsequent step methods
|
|
106
|
+
*/
|
|
107
|
+
private addCrossJoinsToQuery;
|
|
108
|
+
/**
|
|
109
|
+
* Build funnel results CTE that joins all step times for time metric calculation
|
|
110
|
+
*
|
|
111
|
+
* With the sequential CTE pattern, each step CTE already contains only the
|
|
112
|
+
* binding_keys that successfully completed that step. This CTE simply joins
|
|
113
|
+
* them together to enable time difference calculations.
|
|
114
|
+
*
|
|
115
|
+
* No CASE expressions needed - the temporal filtering is already done in each step CTE.
|
|
116
|
+
*/
|
|
117
|
+
private buildFunnelResultsCTE;
|
|
118
|
+
/**
|
|
119
|
+
* Build aggregation CTE with counts and optional time metrics
|
|
120
|
+
*
|
|
121
|
+
* OPTIMIZATION: Uses single-pass aggregation over funnel_joined CTE instead of
|
|
122
|
+
* multiple scalar subqueries. This reduces table scans from 13+ to 1 for a typical
|
|
123
|
+
* 3-step funnel with time metrics.
|
|
124
|
+
*
|
|
125
|
+
* - Step counts: COUNT(*) for step_0, COUNT(step_N_time) for subsequent steps
|
|
126
|
+
* - Time metrics: Uses database-specific conditional aggregation (FILTER clause for
|
|
127
|
+
* PostgreSQL, CASE WHEN for MySQL/SQLite)
|
|
128
|
+
* - Percentiles: Still use subqueries since PERCENTILE_CONT with FILTER is non-standard
|
|
129
|
+
*
|
|
130
|
+
* Important: All SQL fields must have explicit aliases via .as() for Drizzle
|
|
131
|
+
* to properly reference them when selecting from the CTE
|
|
132
|
+
*/
|
|
133
|
+
private buildAggregationCTE;
|
|
134
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SQL, AnyColumn } from 'drizzle-orm';
|
|
2
|
+
import { Cube, SemanticQuery, QueryContext, PhysicalQueryPlan } from '../types';
|
|
3
|
+
import { DateTimeBuilder } from './date-time-builder';
|
|
4
|
+
export declare class GroupByBuilder {
|
|
5
|
+
private dateTimeBuilder;
|
|
6
|
+
constructor(dateTimeBuilder: DateTimeBuilder);
|
|
7
|
+
/**
|
|
8
|
+
* Check if a measure type is a window function
|
|
9
|
+
*/
|
|
10
|
+
isWindowFunctionType(measureType: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Check if a measure type is an aggregate function (requires GROUP BY)
|
|
13
|
+
*
|
|
14
|
+
* Note: 'number' is included because users commonly define measures with raw SQL
|
|
15
|
+
* aggregations (e.g., sql`COUNT(DISTINCT ...)`) and set type: 'number' for the output.
|
|
16
|
+
* These measures still require GROUP BY when used with time dimensions.
|
|
17
|
+
*/
|
|
18
|
+
isAggregateFunctionType(measureType: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Build GROUP BY fields from dimensions and time dimensions
|
|
21
|
+
* Works for both single and multi-cube queries
|
|
22
|
+
*
|
|
23
|
+
* NOTE: GROUP BY is only added when there are AGGREGATE measures.
|
|
24
|
+
* Window functions do not require GROUP BY and operate on individual rows.
|
|
25
|
+
*/
|
|
26
|
+
buildGroupByFields(cubes: Map<string, Cube> | Cube, query: SemanticQuery, context: QueryContext, queryPlan?: PhysicalQueryPlan): (SQL | AnyColumn)[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builders Index
|
|
3
|
+
* Re-exports all query builder components for modular imports
|
|
4
|
+
*/
|
|
5
|
+
export { DateTimeBuilder } from './date-time-builder';
|
|
6
|
+
export { FilterBuilder } from './filter-builder';
|
|
7
|
+
export { GroupByBuilder } from './group-by-builder';
|
|
8
|
+
export { MeasureBuilder } from './measure-builder';
|
|
9
|
+
export { CTEBuilder } from './cte-builder';
|
|
10
|
+
export { ComparisonQueryBuilder } from './comparison-query-builder';
|
|
11
|
+
export { FunnelQueryBuilder } from './funnel-query-builder';
|
|
12
|
+
export { FlowQueryBuilder } from './flow-query-builder';
|
|
13
|
+
export { RetentionQueryBuilder } from './retention-query-builder';
|