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,18 @@
|
|
|
1
|
+
import { ExplainResult } from '../types/executor';
|
|
2
|
+
/**
|
|
3
|
+
* Parse PostgreSQL EXPLAIN output (text format)
|
|
4
|
+
*
|
|
5
|
+
* Example input:
|
|
6
|
+
* "Hash Join (cost=1.09..2.19 rows=1 width=68)"
|
|
7
|
+
* " Hash Cond: (e.department_id = d.id)"
|
|
8
|
+
* " -> Seq Scan on employees e (cost=0.00..1.05 rows=5 width=44)"
|
|
9
|
+
* " Filter: (organisation_id = 'org-1'::text)"
|
|
10
|
+
* " -> Hash (cost=1.04..1.04 rows=4 width=36)"
|
|
11
|
+
* " -> Seq Scan on departments d (cost=0.00..1.04 rows=4 width=36)"
|
|
12
|
+
* "Planning Time: 0.123 ms"
|
|
13
|
+
* "Execution Time: 0.456 ms" (only with ANALYZE)
|
|
14
|
+
*/
|
|
15
|
+
export declare function parsePostgresExplain(rawOutput: string[], sqlQuery: {
|
|
16
|
+
sql: string;
|
|
17
|
+
params?: unknown[];
|
|
18
|
+
}): ExplainResult;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ExplainResult } from '../types/executor';
|
|
2
|
+
/**
|
|
3
|
+
* Parse Snowflake EXPLAIN output
|
|
4
|
+
*
|
|
5
|
+
* Snowflake EXPLAIN output shows the query plan as indented text.
|
|
6
|
+
* Example:
|
|
7
|
+
* "GlobalStats:"
|
|
8
|
+
* " partitionsTotal=1"
|
|
9
|
+
* " partitionsAssigned=1"
|
|
10
|
+
* "1:0 ->Result"
|
|
11
|
+
* "1:1 ->Filter"
|
|
12
|
+
* "1:2 ->TableScan"
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseSnowflakeExplain(rawOutput: string[], sqlQuery: {
|
|
15
|
+
sql: string;
|
|
16
|
+
params?: unknown[];
|
|
17
|
+
}): ExplainResult;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ExplainResult } from '../types/executor';
|
|
2
|
+
/**
|
|
3
|
+
* SQLite EXPLAIN QUERY PLAN row structure
|
|
4
|
+
*/
|
|
5
|
+
interface SQLiteExplainRow {
|
|
6
|
+
id: number;
|
|
7
|
+
parent: number;
|
|
8
|
+
notused: number;
|
|
9
|
+
detail: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parse SQLite EXPLAIN QUERY PLAN output
|
|
13
|
+
*
|
|
14
|
+
* SQLite EXPLAIN QUERY PLAN returns rows with columns:
|
|
15
|
+
* id, parent, notused, detail
|
|
16
|
+
*
|
|
17
|
+
* The 'detail' column contains human-readable operation descriptions
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseSQLiteExplain(rows: SQLiteExplainRow[], sqlQuery: {
|
|
20
|
+
sql: string;
|
|
21
|
+
params?: unknown[];
|
|
22
|
+
}): ExplainResult;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
import { Filter, FilterCondition } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Generates a deterministic cache key for a filter
|
|
5
|
+
* Keys are based on filter content (member, operator, values) not object identity
|
|
6
|
+
*/
|
|
7
|
+
export declare function getFilterKey(filter: Filter): string;
|
|
8
|
+
/**
|
|
9
|
+
* Generates a cache key for time dimension date range filters
|
|
10
|
+
*/
|
|
11
|
+
export declare function getTimeDimensionFilterKey(dimension: string, dateRange: string | string[]): string;
|
|
12
|
+
/**
|
|
13
|
+
* Cache statistics for debugging and monitoring
|
|
14
|
+
*/
|
|
15
|
+
export interface FilterCacheStats {
|
|
16
|
+
hits: number;
|
|
17
|
+
misses: number;
|
|
18
|
+
cacheSize: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Manages filter SQL caching for a single query execution
|
|
22
|
+
*
|
|
23
|
+
* Design principles:
|
|
24
|
+
* - Immutable SQL: Once cached, SQL objects are never modified
|
|
25
|
+
* - Cache lifetime: Created at query start, discarded after query execution
|
|
26
|
+
* - Key by content: Filters with same member/operator/values share SQL
|
|
27
|
+
* - Thread-safe: No shared mutable state between queries
|
|
28
|
+
*/
|
|
29
|
+
export declare class FilterCacheManager {
|
|
30
|
+
private cache;
|
|
31
|
+
private stats;
|
|
32
|
+
/**
|
|
33
|
+
* Get cached SQL or build and cache it
|
|
34
|
+
*
|
|
35
|
+
* @param key - The cache key (use getFilterKey or getTimeDimensionFilterKey)
|
|
36
|
+
* @param builder - Function to build the SQL if not cached
|
|
37
|
+
* @returns The cached or freshly built SQL, or null if builder returns null
|
|
38
|
+
*/
|
|
39
|
+
getOrBuild(key: string, builder: () => SQL | null): SQL | null;
|
|
40
|
+
/**
|
|
41
|
+
* Check if a key exists in the cache without affecting stats
|
|
42
|
+
*/
|
|
43
|
+
has(key: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Get cached SQL without building (returns undefined if not cached)
|
|
46
|
+
*/
|
|
47
|
+
get(key: string): SQL | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Pre-populate cache with multiple filters
|
|
50
|
+
* Useful for batch initialization at query start
|
|
51
|
+
*/
|
|
52
|
+
preload(entries: Array<{
|
|
53
|
+
key: string;
|
|
54
|
+
sql: SQL;
|
|
55
|
+
}>): void;
|
|
56
|
+
/**
|
|
57
|
+
* Store a single entry in the cache
|
|
58
|
+
*/
|
|
59
|
+
set(key: string, sql: SQL): void;
|
|
60
|
+
/**
|
|
61
|
+
* Get cache statistics for debugging
|
|
62
|
+
*/
|
|
63
|
+
getStats(): FilterCacheStats;
|
|
64
|
+
/**
|
|
65
|
+
* Clear the cache (normally not needed as cache is per-query)
|
|
66
|
+
*/
|
|
67
|
+
clear(): void;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Flatten nested AND/OR filters into individual filter conditions
|
|
71
|
+
* Useful for pre-building all filters at query start
|
|
72
|
+
*/
|
|
73
|
+
export declare function flattenFilters(filters: Filter[]): FilterCondition[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SemanticQuery } from './types/query';
|
|
2
|
+
import { TimeGranularity } from './types/core';
|
|
3
|
+
export interface GapFillerConfig {
|
|
4
|
+
/** The time dimension key (e.g., 'Sales.date') */
|
|
5
|
+
timeDimensionKey: string;
|
|
6
|
+
/** Time granularity for bucket generation */
|
|
7
|
+
granularity: TimeGranularity;
|
|
8
|
+
/** Date range [start, end] */
|
|
9
|
+
dateRange: [Date, Date];
|
|
10
|
+
/** Value to fill for missing measures (default: 0) */
|
|
11
|
+
fillValue: number | null;
|
|
12
|
+
/** List of measure keys in the data */
|
|
13
|
+
measures: string[];
|
|
14
|
+
/** List of dimension keys in the data (excluding time dimensions) */
|
|
15
|
+
dimensions: string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Generate all time buckets for a given date range and granularity
|
|
19
|
+
*/
|
|
20
|
+
export declare function generateTimeBuckets(startDate: Date, endDate: Date, granularity: TimeGranularity): Date[];
|
|
21
|
+
/**
|
|
22
|
+
* Fill time series gaps in query result data
|
|
23
|
+
*
|
|
24
|
+
* @param data - Original query result data
|
|
25
|
+
* @param config - Gap filling configuration
|
|
26
|
+
* @returns Data with gaps filled
|
|
27
|
+
*/
|
|
28
|
+
export declare function fillTimeSeriesGaps(data: Record<string, unknown>[], config: GapFillerConfig): Record<string, unknown>[];
|
|
29
|
+
/**
|
|
30
|
+
* Parse date range from query time dimension
|
|
31
|
+
* Handles both array format ['2024-01-01', '2024-01-31'] and string format
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseDateRange(dateRange: string | string[] | undefined): [Date, Date] | null;
|
|
34
|
+
/**
|
|
35
|
+
* Apply gap filling to query result data based on query configuration
|
|
36
|
+
*
|
|
37
|
+
* @param data - Original query result data
|
|
38
|
+
* @param query - The semantic query
|
|
39
|
+
* @param measures - List of measure names in the result
|
|
40
|
+
* @returns Data with gaps filled (if applicable)
|
|
41
|
+
*/
|
|
42
|
+
export declare function applyGapFilling(data: Record<string, unknown>[], query: SemanticQuery, measures: string[]): Record<string, unknown>[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DrizzleDatabase } from './types';
|
|
2
|
+
import { SemanticLayerCompiler } from './compiler';
|
|
3
|
+
/**
|
|
4
|
+
* Drizzle Cube - Semantic Layer for Drizzle ORM
|
|
5
|
+
* Drizzle ORM-first semantic layer with Cube.js compatibility
|
|
6
|
+
*/
|
|
7
|
+
export { SemanticLayerCompiler } from './compiler';
|
|
8
|
+
export { QueryExecutor } from './executor';
|
|
9
|
+
export { LogicalPlanner } from './logical-plan';
|
|
10
|
+
export { DrizzleSqlBuilder } from './physical-plan';
|
|
11
|
+
export { CTEBuilder, ComparisonQueryBuilder, FunnelQueryBuilder, FlowQueryBuilder, RetentionQueryBuilder } from './builders';
|
|
12
|
+
export { CalculatedMeasureResolver, JoinPathResolver } from './resolvers';
|
|
13
|
+
export { LogicalPlanBuilder, IdentityOptimiser, OptimiserPipeline } from './logical-plan';
|
|
14
|
+
export type { LogicalNode, QueryNode, SimpleSource, CTEPreAggregate, CubeRef, MeasureRef, DimensionRef, LogicalPlanWithAnalysis, PlanOptimiser, OptimiserContext } from './logical-plan';
|
|
15
|
+
export { DrizzlePlanBuilder } from './physical-plan';
|
|
16
|
+
export { createDatabaseExecutor, createPostgresExecutor, createSQLiteExecutor, createMySQLExecutor, createDuckDBExecutor, createDatabendExecutor, createSnowflakeExecutor, BaseDatabaseExecutor, PostgresExecutor, SQLiteExecutor, MySQLExecutor, DuckDBExecutor, DatabendExecutor, SnowflakeExecutor } from './executors';
|
|
17
|
+
export { resolveSqlExpression, createMultiCubeContext, resolveCubeReference, getJoinType } from './cube-utils';
|
|
18
|
+
export { defineCube } from './cube-utils';
|
|
19
|
+
export { generateCacheKey, normalizeQuery, fnv1aHash, getCubeInvalidationPattern } from './cache-utils';
|
|
20
|
+
export { MemoryCacheProvider } from './cache-providers';
|
|
21
|
+
export { STEP0_VALIDATION_PROMPT, SYSTEM_PROMPT_TEMPLATE, STEP1_SYSTEM_PROMPT, STEP2_SYSTEM_PROMPT, buildStep0Prompt, buildSystemPrompt, buildStep1Prompt, buildStep2Prompt, EXPLAIN_ANALYSIS_PROMPT, buildExplainAnalysisPrompt, formatCubeSchemaForExplain, formatExistingIndexes } from './prompts';
|
|
22
|
+
export type { Step0Result, PromptContext, DimensionValues, Step1Result } from './prompts';
|
|
23
|
+
export { handleAgentChat, getToolDefinitions, createToolExecutor, buildAgentSystemPrompt } from './agent';
|
|
24
|
+
export type { AgentChatRequest, AgentConfig, AgentObservabilityHooks, AgentSSEEvent, PortletBlockData, MarkdownBlockData, ToolExecutionResult } from './agent';
|
|
25
|
+
export { discoverCubes, findBestFieldMatch, suggestQuery, validateQuery as aiValidateQuery } from './ai';
|
|
26
|
+
export type { CubeDiscoveryResult, DiscoveryOptions, QuerySuggestion, ValidationResult as AIValidationResult, ValidationError as AIValidationError, ValidationWarning as AIValidationWarning } from './ai';
|
|
27
|
+
export type * from './types';
|
|
28
|
+
export type { SQL } from 'drizzle-orm';
|
|
29
|
+
/**
|
|
30
|
+
* Create a new semantic layer instance with Drizzle integration
|
|
31
|
+
* Use this when you need multiple isolated instances
|
|
32
|
+
*/
|
|
33
|
+
export declare function createDrizzleSemanticLayer(options: {
|
|
34
|
+
drizzle: DrizzleDatabase;
|
|
35
|
+
schema?: any;
|
|
36
|
+
}): SemanticLayerCompiler;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logical Plan module — multi-stage query pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - Types: LogicalNode tree types
|
|
6
|
+
* - LogicalPlanBuilder: SemanticQuery → LogicalNode tree
|
|
7
|
+
* - Optimisers: PlanOptimiser interface and built-in passes
|
|
8
|
+
*/
|
|
9
|
+
export type { LogicalNode, LogicalNodeType, LogicalNodeBase, QueryNode, SimpleSource, FullKeyAggregate, CTEPreAggregate, KeysDeduplication, MultiFactMerge, CubeRef, MeasureRef, DimensionRef, TimeDimensionRef, ColumnRef, OrderByRef, JoinRef, LogicalSchema } from './types';
|
|
10
|
+
export { LogicalPlanner } from './logical-planner';
|
|
11
|
+
export { LogicalPlanBuilder } from './logical-plan-builder';
|
|
12
|
+
export type { LogicalPlanWithAnalysis } from './logical-plan-builder';
|
|
13
|
+
export type { PlanOptimiser, OptimiserContext } from './optimiser';
|
|
14
|
+
export { IdentityOptimiser, OptimiserPipeline } from './optimiser';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Cube, QueryContext } from '../types';
|
|
2
|
+
import { QueryAnalysis } from '../types/analysis';
|
|
3
|
+
import { SemanticQuery } from '../types/query';
|
|
4
|
+
import { LogicalPlanner } from './logical-planner';
|
|
5
|
+
import { QueryNode } from './types';
|
|
6
|
+
export interface LogicalPlanWithAnalysis {
|
|
7
|
+
plan: QueryNode;
|
|
8
|
+
analysis: QueryAnalysis;
|
|
9
|
+
}
|
|
10
|
+
export declare class LogicalPlanBuilder {
|
|
11
|
+
private readonly queryPlanner;
|
|
12
|
+
constructor(queryPlanner: LogicalPlanner);
|
|
13
|
+
/**
|
|
14
|
+
* Build a logical plan from a semantic query.
|
|
15
|
+
*/
|
|
16
|
+
plan(cubes: Map<string, Cube>, query: SemanticQuery, ctx: QueryContext): QueryNode;
|
|
17
|
+
/**
|
|
18
|
+
* Build a logical plan and an explicit decision trace for dry-run/explain.
|
|
19
|
+
* The analysis is produced from the same phase outputs used to build the plan.
|
|
20
|
+
*/
|
|
21
|
+
planWithAnalysis(cubes: Map<string, Cube>, query: SemanticQuery, ctx: QueryContext): LogicalPlanWithAnalysis;
|
|
22
|
+
private buildSourceFromPhases;
|
|
23
|
+
private buildSimpleSourceFromPhases;
|
|
24
|
+
/**
|
|
25
|
+
* Detect and build multi-fact merge for star-schema style queries where:
|
|
26
|
+
* - measures come from 2+ cubes
|
|
27
|
+
* - all grouping dimensions/timeDimensions come from one shared dimension cube
|
|
28
|
+
* - each measure cube directly belongsTo/hasOne that shared cube
|
|
29
|
+
*/
|
|
30
|
+
private tryBuildMultiFactMergeSource;
|
|
31
|
+
private hasDirectJoinToSharedDimension;
|
|
32
|
+
private buildGroupQueryNode;
|
|
33
|
+
private projectFiltersToAllowedCubes;
|
|
34
|
+
private projectFilterNodeToAllowedCubes;
|
|
35
|
+
private classifyMeasuresForStrategy;
|
|
36
|
+
private selectMeasureStrategy;
|
|
37
|
+
/**
|
|
38
|
+
* Initial execution scope for keys deduplication:
|
|
39
|
+
* - exactly one multiplied cube
|
|
40
|
+
* - all query measures belong to that cube
|
|
41
|
+
* - only additive measure types currently handled by the physical keys path
|
|
42
|
+
* - no measure filters (HAVING) in the query
|
|
43
|
+
*/
|
|
44
|
+
private isKeysDeduplicationExecutionSupported;
|
|
45
|
+
private queryHasMeasureFilter;
|
|
46
|
+
private buildKeysDeduplicationSource;
|
|
47
|
+
private isDeduplicationSafeMeasure;
|
|
48
|
+
private getPrimaryKeyColumns;
|
|
49
|
+
private deduplicateColumnRefs;
|
|
50
|
+
private buildQueryNode;
|
|
51
|
+
private buildPreAggregationAnalysis;
|
|
52
|
+
private buildMeasureRefs;
|
|
53
|
+
private buildDimensionRefs;
|
|
54
|
+
private buildTimeDimensionRefs;
|
|
55
|
+
private buildOrderByRefs;
|
|
56
|
+
private toCubeRef;
|
|
57
|
+
private buildCTESchema;
|
|
58
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { Cube, QueryContext, PhysicalQueryPlan, SemanticQuery, PrimaryCubeAnalysis, JoinPathAnalysis, QueryWarning } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Pre-aggregation plan for handling hasMany relationships
|
|
4
|
+
*/
|
|
5
|
+
export declare class LogicalPlanner {
|
|
6
|
+
private resolverCache;
|
|
7
|
+
/**
|
|
8
|
+
* Get or create a JoinPathResolver for the given cubes map
|
|
9
|
+
*/
|
|
10
|
+
private getResolver;
|
|
11
|
+
/**
|
|
12
|
+
* Analyze a semantic query to determine which cubes are involved
|
|
13
|
+
*/
|
|
14
|
+
analyzeCubeUsage(query: SemanticQuery): Set<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Build query-level path hints (Cube-style) from all query members:
|
|
17
|
+
* measures, dimensions, time dimensions, filters, and order-by.
|
|
18
|
+
* These hints guide path selection toward the semantic query grain.
|
|
19
|
+
*/
|
|
20
|
+
private collectPathHintCubes;
|
|
21
|
+
/**
|
|
22
|
+
* Recursively extract cube names from filters (handles logical filters)
|
|
23
|
+
*/
|
|
24
|
+
private extractCubeNamesFromFilter;
|
|
25
|
+
/**
|
|
26
|
+
* Extract measures referenced in filters (for CTE inclusion)
|
|
27
|
+
*/
|
|
28
|
+
private extractMeasuresFromFilters;
|
|
29
|
+
/**
|
|
30
|
+
* Recursively extract measures from filters for a specific cube
|
|
31
|
+
* Only includes filter members that are actually measures (not dimensions)
|
|
32
|
+
*/
|
|
33
|
+
private extractMeasuresFromFilter;
|
|
34
|
+
/**
|
|
35
|
+
* Choose the primary cube based on query analysis
|
|
36
|
+
* Uses a consistent strategy to avoid measure order dependencies
|
|
37
|
+
*
|
|
38
|
+
* Delegates to analyzePrimaryCubeSelection() for the actual logic,
|
|
39
|
+
* ensuring a single source of truth for primary cube selection.
|
|
40
|
+
*/
|
|
41
|
+
choosePrimaryCube(cubeNames: string[], query: SemanticQuery, cubes?: Map<string, Cube>): string;
|
|
42
|
+
/**
|
|
43
|
+
* Analyze primary cube selection with candidate details.
|
|
44
|
+
* Exposed for LogicalPlanBuilder so dry-run/analyze can report
|
|
45
|
+
* exactly which selection rule was used.
|
|
46
|
+
*/
|
|
47
|
+
analyzePrimaryCube(cubeNames: string[], query: SemanticQuery, cubes: Map<string, Cube>): PrimaryCubeAnalysis;
|
|
48
|
+
/**
|
|
49
|
+
* Analyze join path for a specific target cube.
|
|
50
|
+
* Exposed for LogicalPlanBuilder to provide join decision trace.
|
|
51
|
+
*/
|
|
52
|
+
analyzeJoinPathForTarget(cubes: Map<string, Cube>, fromCube: string, toCube: string, query?: SemanticQuery): JoinPathAnalysis;
|
|
53
|
+
/**
|
|
54
|
+
* Build join plan for a known primary cube.
|
|
55
|
+
* Exposed for LogicalPlanBuilder so logical planning can compose
|
|
56
|
+
* planner phases directly.
|
|
57
|
+
*/
|
|
58
|
+
buildJoinPlanForPrimary(cubes: Map<string, Cube>, primaryCube: Cube, cubeNames: string[], ctx: QueryContext, query: SemanticQuery): PhysicalQueryPlan['joinCubes'];
|
|
59
|
+
/**
|
|
60
|
+
* Build pre-aggregation CTE plan from a primary cube and join plan.
|
|
61
|
+
* Exposed for LogicalPlanBuilder phase composition.
|
|
62
|
+
*/
|
|
63
|
+
buildPreAggregationCTEs(cubes: Map<string, Cube>, primaryCube: Cube, joinCubes: PhysicalQueryPlan['joinCubes'], query: SemanticQuery, ctx: QueryContext): PhysicalQueryPlan['preAggregationCTEs'];
|
|
64
|
+
/**
|
|
65
|
+
* Generate query warnings from pre-aggregation analysis.
|
|
66
|
+
* Exposed for LogicalPlanBuilder phase composition.
|
|
67
|
+
*/
|
|
68
|
+
buildWarnings(query: SemanticQuery, preAggregationCTEs?: PhysicalQueryPlan['preAggregationCTEs']): QueryWarning[];
|
|
69
|
+
/**
|
|
70
|
+
* Build join plan for multi-cube query
|
|
71
|
+
* Supports both direct joins and transitive joins through intermediate cubes
|
|
72
|
+
*
|
|
73
|
+
* Uses query-aware path selection to prefer joining through cubes that have
|
|
74
|
+
* measures in the query (e.g., joining Teams through EmployeeTeams when
|
|
75
|
+
* EmployeeTeams.count is a measure)
|
|
76
|
+
*/
|
|
77
|
+
private buildJoinPlan;
|
|
78
|
+
/**
|
|
79
|
+
* Plan pre-aggregation CTEs for hasMany relationships to prevent fan-out
|
|
80
|
+
* Note: belongsToMany relationships handle fan-out differently through their junction table structure
|
|
81
|
+
* and don't require CTEs - the two-hop join with the junction table provides natural grouping
|
|
82
|
+
*
|
|
83
|
+
* CRITICAL FAN-OUT PREVENTION LOGIC:
|
|
84
|
+
* When a query contains ANY hasMany relationship in the join graph, ALL cubes with measures
|
|
85
|
+
* that could be affected by row multiplication need CTEs. This includes:
|
|
86
|
+
*
|
|
87
|
+
* 1. Cubes with direct hasMany FROM primary (existing logic)
|
|
88
|
+
* 2. Cubes with measures that would be multiplied due to hasMany elsewhere in the query
|
|
89
|
+
* - Example: Query has Departments.totalBudget + Productivity.recordCount
|
|
90
|
+
* - Employees hasMany → Productivity causes row multiplication
|
|
91
|
+
* - Departments.totalBudget would be inflated without CTE pre-aggregation
|
|
92
|
+
*/
|
|
93
|
+
private planPreAggregationCTEs;
|
|
94
|
+
/**
|
|
95
|
+
* Find join information TO a cube (reverse lookup)
|
|
96
|
+
* Used when the primary cube needs a CTE and we need to find how other cubes join to it
|
|
97
|
+
*/
|
|
98
|
+
private findJoinInfoToCube;
|
|
99
|
+
/**
|
|
100
|
+
* Analyze the join path from primary cube to a target CTE cube.
|
|
101
|
+
* Detects if there are intermediate hasMany relationships that would cause fan-out.
|
|
102
|
+
*
|
|
103
|
+
* Returns information about:
|
|
104
|
+
* - The full join path
|
|
105
|
+
* - Whether there are hasMany relationships ON the path (not just at the end)
|
|
106
|
+
* - Which intermediate tables need to be absorbed into the CTE
|
|
107
|
+
* - The correct join key to use (from primary cube's connection point)
|
|
108
|
+
*
|
|
109
|
+
* @param cubes Map of all registered cubes
|
|
110
|
+
* @param primaryCube The primary cube (FROM clause)
|
|
111
|
+
* @param targetCubeName The CTE cube we're analyzing the path to
|
|
112
|
+
* @param ctx Query context for security filtering
|
|
113
|
+
*/
|
|
114
|
+
private analyzeJoinPathToPrimary;
|
|
115
|
+
/**
|
|
116
|
+
* Compute CTE reasons from the actual join plan entries.
|
|
117
|
+
*
|
|
118
|
+
* Instead of scanning all registered cubes (which causes false positives when
|
|
119
|
+
* unrelated hasMany relationships exist), this walks only the planned joins
|
|
120
|
+
* using the `relationship` field now stored on each JoinCubePlanEntry.
|
|
121
|
+
*
|
|
122
|
+
* Algorithm:
|
|
123
|
+
* 1. Scan join plan entries for hasMany/belongsToMany relationships
|
|
124
|
+
* 2. If none found → return empty map (no CTEs needed)
|
|
125
|
+
* 3. hasMany/belongsToMany targets with measures → 'hasMany'
|
|
126
|
+
* 4. Other join cubes with measures (not hasMany source) → 'fanOutPrevention'
|
|
127
|
+
*/
|
|
128
|
+
private computeCTEReasons;
|
|
129
|
+
/**
|
|
130
|
+
* Find join information for a cube from any cube in the query
|
|
131
|
+
* This extends findHasManyJoinDef to work with any relationship type
|
|
132
|
+
* and to search from any source cube, not just the primary
|
|
133
|
+
*/
|
|
134
|
+
private findJoinInfoForCube;
|
|
135
|
+
/**
|
|
136
|
+
* Find downstream cubes that need join keys included in the CTE.
|
|
137
|
+
*
|
|
138
|
+
* When a query has dimensions from a cube (e.g., Teams.name) and measures from
|
|
139
|
+
* a junction cube (e.g., EmployeeTeams.count), the junction CTE needs to include
|
|
140
|
+
* the join key to the dimension cube (team_id) so the dimension cube can be
|
|
141
|
+
* joined through the CTE instead of via an alternative path.
|
|
142
|
+
*
|
|
143
|
+
* @param cteCube The cube being converted to a CTE (e.g., EmployeeTeams)
|
|
144
|
+
* @param query The semantic query with dimensions and measures
|
|
145
|
+
* @param allCubes Map of all registered cubes
|
|
146
|
+
* @returns Array of downstream join key info for cubes needing join through this CTE
|
|
147
|
+
*/
|
|
148
|
+
private findDownstreamJoinKeys;
|
|
149
|
+
/**
|
|
150
|
+
* Expand calculated measures to include their dependencies
|
|
151
|
+
*/
|
|
152
|
+
private expandCalculatedMeasureDependencies;
|
|
153
|
+
/**
|
|
154
|
+
* Extract measure references from calculatedSql template
|
|
155
|
+
*/
|
|
156
|
+
private extractDependenciesFromTemplate;
|
|
157
|
+
/**
|
|
158
|
+
* Find hasMany join definition from primary cube to target cube
|
|
159
|
+
*/
|
|
160
|
+
private findHasManyJoinDef;
|
|
161
|
+
/**
|
|
162
|
+
* Find filters that need to propagate from related cubes to a CTE cube.
|
|
163
|
+
* When cube A has filters and a hasMany relationship to cube B (the CTE cube),
|
|
164
|
+
* A's filters should propagate into B's CTE via a subquery.
|
|
165
|
+
*
|
|
166
|
+
* Example: Employees.createdAt filter should propagate to Productivity CTE
|
|
167
|
+
* via: employee_id IN (SELECT id FROM employees WHERE created_at >= $date)
|
|
168
|
+
*/
|
|
169
|
+
private findPropagatingFilters;
|
|
170
|
+
/**
|
|
171
|
+
* Extract cube names from filters into a Set (helper for findPropagatingFilters)
|
|
172
|
+
*/
|
|
173
|
+
private extractFilterCubeNamesToSet;
|
|
174
|
+
/**
|
|
175
|
+
* Extract filters for a specific cube from the filter array
|
|
176
|
+
*
|
|
177
|
+
* Logic for preserving filter semantics:
|
|
178
|
+
* - AND: Safe to extract only matching branches (AND of fewer conditions is more permissive)
|
|
179
|
+
* - OR: Must include ALL branches or skip entirely (partial OR changes semantics)
|
|
180
|
+
* If any branch belongs to another cube, skip the entire OR to be safe
|
|
181
|
+
* since we can't evaluate the other cube's conditions
|
|
182
|
+
*/
|
|
183
|
+
private extractFiltersForCube;
|
|
184
|
+
/**
|
|
185
|
+
* Check if all simple filters in a filter array belong to the specified cube
|
|
186
|
+
* Recursively checks nested AND/OR filters
|
|
187
|
+
*/
|
|
188
|
+
private allFiltersFromCube;
|
|
189
|
+
/**
|
|
190
|
+
* Extract time dimension date range filters as regular filters for a specific cube
|
|
191
|
+
*/
|
|
192
|
+
private extractTimeDimensionFiltersForCube;
|
|
193
|
+
/**
|
|
194
|
+
* Analyze why a particular cube was chosen as primary
|
|
195
|
+
*/
|
|
196
|
+
private analyzePrimaryCubeSelection;
|
|
197
|
+
/**
|
|
198
|
+
* Analyze the join path between two cubes with detailed step information
|
|
199
|
+
*
|
|
200
|
+
* Uses JoinPathResolver.findPath() for the actual path finding,
|
|
201
|
+
* then converts the result to human-readable analysis format.
|
|
202
|
+
*/
|
|
203
|
+
private analyzeJoinPath;
|
|
204
|
+
private convertInternalPathToJoinPathSteps;
|
|
205
|
+
private buildJoinPathSelectionAnalysis;
|
|
206
|
+
private mapPreferredCandidate;
|
|
207
|
+
/**
|
|
208
|
+
* Generate warnings for query edge cases that users should be aware of.
|
|
209
|
+
* Currently detects:
|
|
210
|
+
* - FAN_OUT_NO_DIMENSIONS: Query has hasMany CTEs but no dimensions to group by
|
|
211
|
+
*
|
|
212
|
+
* Note: AVG measures in hasMany CTEs can produce mathematically imprecise results
|
|
213
|
+
* (average of averages vs weighted average), but this warning was removed as it
|
|
214
|
+
* fired too aggressively. The issue only occurs when the outer grouping is coarser
|
|
215
|
+
* than the CTE grouping, which is rare in practice. The limitation is documented
|
|
216
|
+
* in executor.ts comments.
|
|
217
|
+
*/
|
|
218
|
+
private generateWarnings;
|
|
219
|
+
/**
|
|
220
|
+
* Detect when a query has measures from multiple cubes with hasMany relationships
|
|
221
|
+
* but no dimensions to provide grouping context.
|
|
222
|
+
*
|
|
223
|
+
* This is an edge case where:
|
|
224
|
+
* - Query has measures from 2+ cubes
|
|
225
|
+
* - At least one CTE exists (indicating hasMany relationship)
|
|
226
|
+
* - Query has NO dimensions AND NO time dimensions with granularity
|
|
227
|
+
*
|
|
228
|
+
* The SQL is technically correct (CTEs with GROUP BY on join keys), but users
|
|
229
|
+
* may be confused by the aggregated results without visible grouping.
|
|
230
|
+
*/
|
|
231
|
+
private checkFanOutNoDimensions;
|
|
232
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LogicalNode } from './types';
|
|
2
|
+
/** Context available to optimiser passes */
|
|
3
|
+
export interface OptimiserContext {
|
|
4
|
+
/** Database engine type for engine-specific rewrites */
|
|
5
|
+
engineType: 'postgres' | 'mysql' | 'sqlite' | 'duckdb';
|
|
6
|
+
}
|
|
7
|
+
/** A single optimiser pass that rewrites a logical plan */
|
|
8
|
+
export interface PlanOptimiser {
|
|
9
|
+
/** Human-readable name for debugging / explain output */
|
|
10
|
+
readonly name: string;
|
|
11
|
+
/** Rewrite the plan tree. Must return a valid plan (may return the same reference). */
|
|
12
|
+
optimise(plan: LogicalNode, context: OptimiserContext): LogicalNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* No-op optimiser — returns the plan unchanged.
|
|
16
|
+
* Used as the default in Phase 1 and as a baseline for testing.
|
|
17
|
+
*/
|
|
18
|
+
export declare class IdentityOptimiser implements PlanOptimiser {
|
|
19
|
+
readonly name = "identity";
|
|
20
|
+
optimise(plan: LogicalNode): LogicalNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Runs a sequence of optimiser passes in order.
|
|
24
|
+
* Short-circuits if a pass returns a different reference (for future use).
|
|
25
|
+
*/
|
|
26
|
+
export declare class OptimiserPipeline implements PlanOptimiser {
|
|
27
|
+
readonly name = "pipeline";
|
|
28
|
+
private passes;
|
|
29
|
+
constructor(passes?: PlanOptimiser[]);
|
|
30
|
+
optimise(plan: LogicalNode, context: OptimiserContext): LogicalNode;
|
|
31
|
+
addPass(pass: PlanOptimiser): void;
|
|
32
|
+
}
|