drizzle-cube 0.5.7 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/adapters/adapters/hono/agent-handler.d.ts +9 -0
- package/dist/adapters/adapters/hono/mcp-handler.d.ts +37 -0
- package/dist/adapters/adapters/mcp-tools-handlers.d.ts +18 -0
- package/dist/adapters/adapters/nextjs/mcp-handler.d.ts +36 -0
- package/dist/adapters/{utils.d.ts → adapters/utils.d.ts} +6 -81
- package/dist/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +50 -50
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +78 -78
- package/dist/adapters/google-BOnRIN1w.cjs +2 -0
- package/dist/{server/google-CFYljAOF.js → adapters/google-CvKM9yVM.js} +83 -71
- package/dist/adapters/{handler-Dz1F4iwf.js → handler-CfgE0JSL.js} +515 -578
- package/dist/adapters/handler-Cn0dOctE.cjs +25 -0
- package/dist/adapters/hono/index.cjs +2 -2
- package/dist/adapters/hono/index.js +208 -178
- package/dist/adapters/locale-DDvZDFVn.js +8114 -0
- package/dist/adapters/locale-ZLUUNUxr.cjs +166 -0
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +49 -38
- package/dist/adapters/mcp-transport-Chiaj4ll.cjs +40 -0
- package/dist/adapters/mcp-transport-H96VG3WY.js +591 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +190 -197
- package/dist/{server/openai-y7GhJNdn.js → adapters/openai-B5jEiqiB.js} +776 -719
- package/dist/adapters/openai-D0musiYP.cjs +17 -0
- package/dist/{server/openai-DiVskd89.js → adapters/openai-cDlFSTk6.js} +61 -59
- package/dist/adapters/openai-vXvLni8v.cjs +1 -0
- package/dist/adapters/{utils-DosuoabY.js → utils-BPWZsX7k.js} +1285 -1220
- package/dist/adapters/utils-_whV4fXL.cjs +128 -0
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.js +2 -2
- package/dist/client/charts/ChartLoader.d.ts +3 -17
- package/dist/client/charts/chartComponentRegistry.d.ts +46 -0
- package/dist/client/charts/chartConfigHelpers.d.ts +38 -0
- package/dist/client/charts.js +14 -13
- package/dist/client/chunks/{DashboardEditModal-6KRE36mm.js → DashboardEditModal-okVfH8ZK.js} +5446 -4486
- package/dist/client/chunks/DashboardEditModal-okVfH8ZK.js.map +1 -0
- package/dist/client/chunks/{RetentionCombinedChart-CCpu0C-s.js → RetentionCombinedChart-BgbDhsPz.js} +10 -10
- package/dist/client/chunks/{RetentionCombinedChart-CCpu0C-s.js.map → RetentionCombinedChart-BgbDhsPz.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-B24PiIfr.js → RetentionHeatmap-DjXZaTPq.js} +5 -5
- package/dist/client/chunks/{RetentionHeatmap-B24PiIfr.js.map → RetentionHeatmap-DjXZaTPq.js.map} +1 -1
- package/dist/client/chunks/analysis-builder-DB88FojM.js +5674 -0
- package/dist/client/chunks/analysis-builder-DB88FojM.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-x576-O5p.js → analysis-builder-shared-BVK4TYfR.js} +1578 -1292
- package/dist/client/chunks/analysis-builder-shared-BVK4TYfR.js.map +1 -0
- package/dist/client/chunks/{chart-activity-grid-CiHrLH6Y.js → chart-activity-grid-DX0SJbxs.js} +642 -494
- package/dist/client/chunks/chart-activity-grid-DX0SJbxs.js.map +1 -0
- package/dist/client/chunks/chart-area-of01_62R.js +775 -0
- package/dist/client/chunks/chart-area-of01_62R.js.map +1 -0
- package/dist/client/chunks/chart-bar-BqelQE_I.js +194 -0
- package/dist/client/chunks/chart-bar-BqelQE_I.js.map +1 -0
- package/dist/client/chunks/{chart-box-plot-Bu9hy-17.js → chart-box-plot-kkBixZ27.js} +2 -2
- package/dist/client/chunks/{chart-box-plot-Bu9hy-17.js.map → chart-box-plot-kkBixZ27.js.map} +1 -1
- package/dist/client/chunks/chart-bubble-B2he1--4.js +221 -0
- package/dist/client/chunks/chart-bubble-B2he1--4.js.map +1 -0
- package/dist/client/chunks/{chart-candlestick-Dau5AF4E.js → chart-candlestick-DZp19Tzh.js} +2 -2
- package/dist/client/chunks/{chart-candlestick-Dau5AF4E.js.map → chart-candlestick-DZp19Tzh.js.map} +1 -1
- package/dist/client/chunks/chart-config-area-BNigHUy8.js +124 -0
- package/dist/client/chunks/chart-config-area-BNigHUy8.js.map +1 -0
- package/dist/client/chunks/chart-config-bar-DSO_LRTx.js +54 -0
- package/dist/client/chunks/chart-config-bar-DSO_LRTx.js.map +1 -0
- package/dist/client/chunks/{chart-config-box-plot-DJ-dWWXA.js → chart-config-box-plot-oW8axV2q.js} +5 -10
- package/dist/client/chunks/chart-config-box-plot-oW8axV2q.js.map +1 -0
- package/dist/client/chunks/{chart-config-gauge-DSwC04l0.js → chart-config-gauge-Dq-_H9UN.js} +5 -7
- package/dist/client/chunks/chart-config-gauge-Dq-_H9UN.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-delta-D6BIkHL3.js → chart-config-kpi-delta-DSQbvqu_.js} +5 -10
- package/dist/client/chunks/chart-config-kpi-delta-DSQbvqu_.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-number-Bx-V9a62.js → chart-config-kpi-number-EFSWY1We.js} +5 -7
- package/dist/client/chunks/chart-config-kpi-number-EFSWY1We.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-text-CcqC1u-8.js → chart-config-kpi-text-KM3V5X2u.js} +5 -7
- package/dist/client/chunks/chart-config-kpi-text-KM3V5X2u.js.map +1 -0
- package/dist/client/chunks/{chart-config-line-Db3jDsWc.js → chart-config-line-D6jG8PCH.js} +9 -36
- package/dist/client/chunks/chart-config-line-D6jG8PCH.js.map +1 -0
- package/dist/client/chunks/{chart-config-pie-DD4SmRTF.js → chart-config-pie-BhzW-fdn.js} +6 -16
- package/dist/client/chunks/chart-config-pie-BhzW-fdn.js.map +1 -0
- package/dist/client/chunks/{chart-config-radar-CC2XAaGr.js → chart-config-radar-D7REP1q_.js} +6 -16
- package/dist/client/chunks/chart-config-radar-D7REP1q_.js.map +1 -0
- package/dist/client/chunks/{chart-config-radial-bar-DmxKx1R0.js → chart-config-radial-bar-Byx6qOPU.js} +6 -16
- package/dist/client/chunks/chart-config-radial-bar-Byx6qOPU.js.map +1 -0
- package/dist/client/chunks/{chart-config-tree-map-BI-oQStO.js → chart-config-tree-map-DVrvf3yQ.js} +6 -16
- package/dist/client/chunks/chart-config-tree-map-DVrvf3yQ.js.map +1 -0
- package/dist/client/chunks/{chart-config-waterfall-DSnyixbI.js → chart-config-waterfall-DmFeQdIk.js} +5 -10
- package/dist/client/chunks/chart-config-waterfall-DmFeQdIk.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-Cm5jrpaw.js → chart-data-table-CKauQXme.js} +1046 -1121
- package/dist/client/chunks/chart-data-table-CKauQXme.js.map +1 -0
- package/dist/client/chunks/{chart-funnel-Eke8IPtG.js → chart-funnel-CToKSBaL.js} +184 -222
- package/dist/client/chunks/chart-funnel-CToKSBaL.js.map +1 -0
- package/dist/client/chunks/chart-gauge-DTVezSk7.js +403 -0
- package/dist/client/chunks/chart-gauge-DTVezSk7.js.map +1 -0
- package/dist/client/chunks/chart-heat-map-DTuUl0BR.js +236 -0
- package/dist/client/chunks/chart-heat-map-DTuUl0BR.js.map +1 -0
- package/dist/client/chunks/chart-kpi-delta-Dn-jjO-2.js +408 -0
- package/dist/client/chunks/chart-kpi-delta-Dn-jjO-2.js.map +1 -0
- package/dist/client/chunks/chart-kpi-number-P_WBiO5S.js +244 -0
- package/dist/client/chunks/chart-kpi-number-P_WBiO5S.js.map +1 -0
- package/dist/client/chunks/chart-kpi-text-C-Y4eb5H.js +185 -0
- package/dist/client/chunks/chart-kpi-text-C-Y4eb5H.js.map +1 -0
- package/dist/client/chunks/chart-line-DKgrQA6c.js +101 -0
- package/dist/client/chunks/chart-line-DKgrQA6c.js.map +1 -0
- package/dist/client/chunks/{chart-markdown-BPW-EAm9.js → chart-markdown-CV75S_zL.js} +1359 -1240
- package/dist/client/chunks/chart-markdown-CV75S_zL.js.map +1 -0
- package/dist/client/chunks/{chart-measure-profile-BI3kADCp.js → chart-measure-profile-Ket8fJyf.js} +7 -7
- package/dist/client/chunks/{chart-measure-profile-BI3kADCp.js.map → chart-measure-profile-Ket8fJyf.js.map} +1 -1
- package/dist/client/chunks/chart-pie-ByieAX5H.js +119 -0
- package/dist/client/chunks/chart-pie-ByieAX5H.js.map +1 -0
- package/dist/client/chunks/chart-radar-CiSwHWp4.js +138 -0
- package/dist/client/chunks/chart-radar-CiSwHWp4.js.map +1 -0
- package/dist/client/chunks/chart-radial-bar-BF6Mhl6f.js +122 -0
- package/dist/client/chunks/chart-radial-bar-BF6Mhl6f.js.map +1 -0
- package/dist/client/chunks/{chart-sankey-CFzjGvZX.js → chart-sankey-DjrvKw6K.js} +36 -39
- package/dist/client/chunks/{chart-sankey-CFzjGvZX.js.map → chart-sankey-DjrvKw6K.js.map} +1 -1
- package/dist/client/chunks/chart-scatter-Dd9WFqnS.js +258 -0
- package/dist/client/chunks/chart-scatter-Dd9WFqnS.js.map +1 -0
- package/dist/client/chunks/{chart-sunburst-91Q2tzaB.js → chart-sunburst-leGpuDj7.js} +3 -3
- package/dist/client/chunks/{chart-sunburst-91Q2tzaB.js.map → chart-sunburst-leGpuDj7.js.map} +1 -1
- package/dist/client/chunks/chart-tree-map-Ceq5sLZA.js +323 -0
- package/dist/client/chunks/chart-tree-map-Ceq5sLZA.js.map +1 -0
- package/dist/client/chunks/{chart-waterfall-DcHbbPaG.js → chart-waterfall-DyvQReN5.js} +7 -7
- package/dist/client/chunks/{chart-waterfall-DcHbbPaG.js.map → chart-waterfall-DyvQReN5.js.map} +1 -1
- package/dist/client/chunks/{charts-core-CrBDYN6N.js → charts-core-DaXSt1Dd.js} +2 -2
- package/dist/client/chunks/{charts-core-CrBDYN6N.js.map → charts-core-DaXSt1Dd.js.map} +1 -1
- package/dist/client/chunks/charts-loader-DdTeCeNo.js +84 -0
- package/dist/client/chunks/charts-loader-DdTeCeNo.js.map +1 -0
- package/dist/client/chunks/{core-DsAWNRRv.js → core-D7vPfUIe.js} +2 -2
- package/dist/client/chunks/{core-DsAWNRRv.js.map → core-D7vPfUIe.js.map} +1 -1
- package/dist/client/chunks/{nl-NL-oyr2wENY.js → nl-NL-2zTAWTej.js} +8 -2
- package/dist/client/chunks/{nl-NL-oyr2wENY.js.map → nl-NL-2zTAWTej.js.map} +1 -1
- package/dist/client/chunks/retention-ChW9jYdy.js.map +1 -1
- package/dist/client/chunks/{schema-visualization-BszcrmZX.js → schema-visualization-Cb_E9_Gd.js} +12 -12
- package/dist/client/chunks/{schema-visualization-BszcrmZX.js.map → schema-visualization-Cb_E9_Gd.js.map} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-B5wCDJSj.js → useDirtyStateTracking-MbpxH_v6.js} +95 -84
- package/dist/client/chunks/useDirtyStateTracking-MbpxH_v6.js.map +1 -0
- package/dist/client/chunks/{useExplainAI-CCeCYzDm.js → useExplainAI-evnZkjCY.js} +14 -14
- package/dist/client/chunks/{useExplainAI-CCeCYzDm.js.map → useExplainAI-evnZkjCY.js.map} +1 -1
- package/dist/client/chunks/{utils-kqa-JIMg.js → utils-3P6z1vz5.js} +3 -3
- package/dist/client/chunks/{utils-kqa-JIMg.js.map → utils-3P6z1vz5.js.map} +1 -1
- package/dist/client/chunks/{vendor-0hJNlZXQ.js → vendor-DSpR0IW6.js} +43 -43
- package/dist/client/chunks/{vendor-0hJNlZXQ.js.map → vendor-DSpR0IW6.js.map} +1 -1
- package/dist/client/components/AgenticNotebook/agentChatParts.d.ts +34 -0
- package/dist/client/components/AgenticNotebook/chatMessageParts.d.ts +39 -0
- package/dist/client/components/AgenticNotebook/useAgentChatController.d.ts +25 -0
- package/dist/client/components/AgenticNotebook/useNotebookAutosave.d.ts +12 -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/AnalysisQueryPanelParts.d.ts +64 -0
- package/dist/client/components/AnalysisBuilder/AnalysisResultsHeader.d.ts +67 -0
- package/dist/client/components/AnalysisBuilder/BreakdownComparisonToggle.d.ts +13 -0
- package/dist/client/components/AnalysisBuilder/BreakdownRow.d.ts +26 -0
- package/dist/client/components/AnalysisBuilder/DisplayOptionControl.d.ts +10 -0
- package/dist/client/components/AnalysisBuilder/ExecutionPlanPanelParts.d.ts +22 -0
- 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/FieldSearchResults.d.ts +16 -0
- package/dist/client/components/AnalysisBuilder/FilterConfigModal.d.ts +2 -1
- package/dist/client/components/AnalysisBuilder/FilterValueInput.d.ts +63 -0
- package/dist/client/components/AnalysisBuilder/FlowDepthControls.d.ts +10 -0
- package/dist/client/components/AnalysisBuilder/FlowVisualizationPicker.d.ts +7 -0
- package/dist/client/components/AnalysisBuilder/LegacyBooleanOptions.d.ts +8 -0
- package/dist/client/components/AnalysisBuilder/LimitSection.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/MetricRow.d.ts +23 -0
- package/dist/client/components/AnalysisBuilder/SectionHeading.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/SortToggleButton.d.ts +13 -0
- package/dist/client/components/AnalysisBuilder/StringArrayInput.d.ts +17 -0
- package/dist/client/components/AnalysisBuilder/filterConfigModalUtils.d.ts +30 -0
- package/dist/client/components/AnalysisBuilder/hooks/useAnalysisBuilderImperativeHandle.d.ts +13 -0
- package/dist/client/components/AnalysisBuilder/hooks/useDragReorder.d.ts +25 -0
- package/dist/client/components/AnalysisBuilder/hooks/useFieldSearchKeyboard.d.ts +11 -0
- package/dist/client/components/AnalysisBuilder/utils/axisConfigUtils.d.ts +23 -0
- package/dist/client/components/AnalysisBuilder/utils/executionPlanMarkdown.d.ts +8 -0
- package/dist/client/components/AnalysisBuilder/utils/fieldUtils.d.ts +5 -0
- package/dist/client/components/AnalysisBuilder/utils/resultsPanelDerive.d.ts +68 -0
- package/dist/client/components/AnalysisBuilder/utils/shareStateUtils.d.ts +68 -0
- package/dist/client/components/AnalysisBuilder/utils/sortUtils.d.ts +7 -0
- 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/CompactFilterBarParts.d.ts +26 -0
- package/dist/client/components/DashboardFilters/DashboardFilterConfigModal.d.ts +1 -1
- package/dist/client/components/DashboardFilters/DashboardFilterConfigModalParts.d.ts +27 -0
- package/dist/client/components/DashboardFilters/DashboardFilterItem.d.ts +1 -1
- package/dist/client/components/DashboardFilters/DashboardFilterValueInput.d.ts +39 -0
- package/dist/client/components/DashboardFilters/dashboardFilterConfigModalUtils.d.ts +21 -0
- package/dist/client/components/DashboardFilters/useCompactFilterBar.d.ts +19 -0
- package/dist/client/components/DashboardFilters/useDashboardFilterConfigModal.d.ts +69 -0
- package/dist/client/components/DashboardFilters/useDateRangeState.d.ts +19 -0
- package/dist/client/components/DashboardFilters/useFilterDropdowns.d.ts +21 -0
- package/dist/client/components/DashboardFilters/useFilterValueFetch.d.ts +23 -0
- package/dist/client/components/DashboardGrid.d.ts +1 -1
- package/dist/client/components/DashboardPortletCard.d.ts +2 -57
- 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/analyticsPortlet/PortletChart.d.ts +31 -0
- package/dist/client/components/analyticsPortlet/PortletChartView.d.ts +35 -0
- package/dist/client/components/analyticsPortlet/PortletStates.d.ts +65 -0
- package/dist/client/components/analyticsPortlet/parsePortletQuery.d.ts +22 -0
- package/dist/client/components/analyticsPortlet/portletRenderState.d.ts +31 -0
- package/dist/client/components/analyticsPortlet/usePortletDebugData.d.ts +37 -0
- package/dist/client/components/analyticsPortlet/usePortletDrillState.d.ts +17 -0
- package/dist/client/components/analyticsPortlet/usePortletQueryResults.d.ts +37 -0
- package/dist/client/components/charts/ActivityGridChart.helpers.d.ts +33 -0
- package/dist/client/components/charts/ActivityGridChart.render.d.ts +31 -0
- package/dist/client/components/charts/AxisFormatControls.d.ts +5 -3
- package/dist/client/components/charts/BarChart.helpers.d.ts +23 -0
- package/dist/client/components/charts/BarSeries.d.ts +29 -0
- package/dist/client/components/charts/BubbleChart.helpers.d.ts +43 -0
- package/dist/client/components/charts/BubbleChart.render.d.ts +21 -0
- 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/ChartStates.d.ts +38 -0
- package/dist/client/components/charts/ChartTooltip.d.ts +1 -1
- package/dist/client/components/charts/FunnelChart.helpers.d.ts +25 -0
- package/dist/client/components/charts/FunnelViews.d.ts +16 -0
- package/dist/client/components/charts/HeatMapCanvas.d.ts +25 -0
- package/dist/client/components/charts/HeatMapChart.helpers.d.ts +64 -0
- package/dist/client/components/charts/KpiDelta.helpers.d.ts +20 -0
- package/dist/client/components/charts/KpiNumber.helpers.d.ts +30 -0
- package/dist/client/components/charts/KpiStates.d.ts +19 -0
- package/dist/client/components/charts/MissingDependencyFallback.d.ts +1 -1
- package/dist/client/components/charts/ScatterChart.helpers.d.ts +43 -0
- package/dist/client/components/charts/ScatterSeries.d.ts +17 -0
- package/dist/client/components/charts/ScatterTooltip.d.ts +21 -0
- package/dist/client/components/charts/TreeMapChart.helpers.d.ts +37 -0
- package/dist/client/components/charts/TreeMapContent.d.ts +24 -0
- package/dist/client/components/charts/TreeMapLegend.d.ts +13 -0
- package/dist/client/components/charts/cartesianChartHelpers.d.ts +126 -0
- package/dist/client/components/charts/chartAxisResolution.d.ts +32 -0
- package/dist/client/components/charts/chartScaffolding.d.ts +77 -0
- package/dist/client/components/charts/gaugeChartHelpers.d.ts +36 -0
- package/dist/client/components/charts/kpiTextHelpers.d.ts +46 -0
- package/dist/client/components/charts/radarChartHelpers.d.ts +14 -0
- package/dist/client/components/charts/radialBarChartHelpers.d.ts +22 -0
- package/dist/client/components/charts/useChartDimensions.d.ts +20 -0
- package/dist/client/components/charts/useKpiDimensions.d.ts +30 -0
- package/dist/client/components/dashboard/DashboardContext.d.ts +2 -2
- package/dist/client/components/dashboard/DashboardCoordinator.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardEditBar.d.ts +5 -0
- package/dist/client/components/dashboard/DashboardFilterBar.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardGridSurface.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardModals.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardProvider.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardToolbar.d.ts +1 -1
- package/dist/client/components/dashboard/LayoutModeToggle.d.ts +10 -0
- package/dist/client/components/dashboard/dashboardGridUtils.d.ts +1 -1
- package/dist/client/components/dashboardPortletCard/FilterFieldChip.d.ts +12 -0
- package/dist/client/components/dashboardPortletCard/PortletCardHeader.d.ts +43 -0
- package/dist/client/components/dashboardPortletCard/cardStyles.d.ts +33 -0
- package/dist/client/components/dashboardPortletCard/filterField.d.ts +12 -0
- package/dist/client/components/dashboardPortletCard/propsEqual.d.ts +55 -0
- package/dist/client/components/dashboardPortletCard/usePortletCardActions.d.ts +16 -0
- package/dist/client/components/portletAnalysisModal/saveValidation.d.ts +8 -0
- package/dist/client/components/shared/dateRangeUtils.d.ts +40 -0
- package/dist/client/components/shared/filterDisplayUtils.d.ts +10 -0
- package/dist/client/components/shared/filterItem/FilterDateRangeSelector.d.ts +17 -0
- package/dist/client/components/shared/filterItem/FilterFieldDropdown.d.ts +16 -0
- package/dist/client/components/shared/filterItem/dateRangeSync.d.ts +14 -0
- package/dist/client/components/shared/filterItem/fieldVisuals.d.ts +5 -0
- package/dist/client/components/shared/filterValueSelector/FilterValueInputs.d.ts +55 -0
- package/dist/client/components/shared/filterValueSelector/useFilterValueSelectorState.d.ts +25 -0
- package/dist/client/components/shared/queryFieldUtils.d.ts +21 -0
- package/dist/client/components/shared/utils.d.ts +4 -43
- package/dist/client/components.js +3 -3
- package/dist/client/hooks/agentChatStream.d.ts +39 -0
- package/dist/client/hooks/analysisQueryExecutionModes.d.ts +133 -0
- package/dist/client/hooks/dashboard/useDashboardController.d.ts +2 -2
- package/dist/client/hooks/drillNavigation.d.ts +25 -0
- package/dist/client/hooks/useDashboardHook.d.ts +2 -2
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons.d.ts +1 -1
- package/dist/client/icons.js +2 -2
- package/dist/client/index.js +816 -669
- 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/shared/chartConfigBuilders.d.ts +18 -0
- package/dist/client/shared/components/QueryAnalysisPanel.sections.d.ts +41 -0
- package/dist/client/shared/queryTransforms.d.ts +20 -0
- package/dist/client/shared/utils.d.ts +2 -4
- 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/stores/optionsToAnalysisConfig.d.ts +17 -0
- 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/axisValueFormatting.d.ts +32 -0
- 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/timeValueFormatting.d.ts +32 -0
- package/dist/client/utils.js +6 -6
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +55 -55
- package/dist/server/google-BOnRIN1w.cjs +2 -0
- package/dist/{adapters/google-CFYljAOF.js → server/google-CvKM9yVM.js} +83 -71
- package/dist/server/index.cjs +179 -211
- package/dist/server/index.d.ts +2 -5050
- package/dist/server/index.js +6360 -6462
- package/dist/{adapters/openai-y7GhJNdn.js → server/openai-B5jEiqiB.js} +776 -719
- package/dist/server/openai-D0musiYP.cjs +17 -0
- package/dist/{adapters/openai-DiVskd89.js → server/openai-cDlFSTk6.js} +61 -59
- package/dist/server/openai-vXvLni8v.cjs +1 -0
- package/dist/server/server/adapters/base-adapter.d.ts +332 -0
- package/dist/server/server/adapters/databend-adapter.d.ts +63 -0
- package/dist/server/server/adapters/duckdb-adapter.d.ts +68 -0
- package/dist/server/server/adapters/mysql-adapter.d.ts +65 -0
- package/dist/server/server/adapters/postgres-adapter.d.ts +55 -0
- package/dist/server/server/adapters/singlestore-adapter.d.ts +4 -0
- package/dist/server/server/adapters/snowflake-adapter.d.ts +53 -0
- package/dist/server/server/adapters/sqlite-adapter.d.ts +120 -0
- package/dist/server/server/adapters/window-function-builder.d.ts +11 -0
- package/dist/server/server/agent/chart-validation.d.ts +22 -0
- package/dist/server/server/agent/handler-steps.d.ts +37 -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-helpers.d.ts +29 -0
- package/dist/server/server/ai/discovery.d.ts +66 -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-helpers.d.ts +33 -0
- package/dist/server/server/ai/suggestion.d.ts +16 -0
- package/dist/server/server/ai/validation-helpers.d.ts +21 -0
- package/dist/server/server/ai/validation.d.ts +31 -0
- package/dist/server/server/builders/analysis-utils.d.ts +106 -0
- package/dist/server/server/builders/comparison-query-builder.d.ts +70 -0
- package/dist/server/server/builders/cte-builder.d.ts +108 -0
- package/dist/server/server/builders/date-time-builder.d.ts +34 -0
- package/dist/server/server/builders/date-time-helpers.d.ts +34 -0
- package/dist/server/server/builders/filter-builder.d.ts +25 -0
- package/dist/server/server/builders/filter-operators.d.ts +23 -0
- package/dist/server/server/builders/flow-query-builder.d.ts +136 -0
- package/dist/server/server/builders/funnel-query-builder.d.ts +145 -0
- package/dist/server/server/builders/group-by-builder.d.ts +38 -0
- package/dist/server/server/builders/index.d.ts +13 -0
- package/dist/server/server/builders/measure-builder.d.ts +185 -0
- package/dist/server/server/builders/retention-query-builder.d.ts +98 -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 +85 -0
- package/dist/server/server/compiler-metadata.d.ts +11 -0
- package/dist/server/server/compiler.d.ts +212 -0
- package/dist/server/server/cube-utils.d.ts +158 -0
- package/dist/server/server/database-utils.d.ts +18 -0
- package/dist/server/server/execution/annotation-builder.d.ts +12 -0
- package/dist/server/server/execution/filter-cache-preloader.d.ts +19 -0
- package/dist/server/server/execution/mode-router.d.ts +25 -0
- package/dist/server/server/execution/query-result-cache.d.ts +21 -0
- package/dist/server/server/execution/result-post-processor.d.ts +10 -0
- package/dist/server/server/executor.d.ts +186 -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/explain-utils.d.ts +28 -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/explain-tree.d.ts +20 -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 +48 -0
- package/dist/server/server/index.d.ts +38 -0
- package/dist/server/server/logical-plan/cte-planner-helpers.d.ts +37 -0
- package/dist/server/server/logical-plan/cte-planner.d.ts +104 -0
- package/dist/server/server/logical-plan/filter-propagation.d.ts +44 -0
- package/dist/server/server/logical-plan/index.d.ts +19 -0
- package/dist/server/server/logical-plan/join-planner.d.ts +27 -0
- package/dist/server/server/logical-plan/logical-plan-builder.d.ts +58 -0
- package/dist/server/server/logical-plan/logical-planner.d.ts +39 -0
- package/dist/server/server/logical-plan/optimiser.d.ts +34 -0
- package/dist/server/server/logical-plan/plan-analysis-reporter.d.ts +59 -0
- package/dist/server/server/logical-plan/planner-utils.d.ts +20 -0
- package/dist/server/server/logical-plan/types.d.ts +199 -0
- package/dist/server/server/measure-classification.d.ts +40 -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 +118 -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 +8 -0
- package/dist/server/server/physical-plan/processors/joins-processor.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/keys-dedup-processor.d.ts +13 -0
- package/dist/server/server/physical-plan/processors/multi-fact-processor.d.ts +13 -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 +38 -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/query-handlers.d.ts +79 -0
- package/dist/server/server/query-modes.d.ts +28 -0
- package/dist/server/server/query-validator.d.ts +9 -0
- package/dist/server/server/resolvers/calculated-measure-resolver.d.ts +98 -0
- package/dist/server/server/resolvers/index.d.ts +6 -0
- package/dist/server/server/resolvers/join-path-resolver.d.ts +158 -0
- package/dist/server/server/sql-format.d.ts +11 -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 +544 -0
- package/dist/server/server/types/executor.d.ts +156 -0
- package/dist/server/server/types/flow.d.ts +144 -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/dist/server/server/types/validation.d.ts +14 -0
- package/package.json +15 -8
- package/dist/adapters/google-DUlXeeDA.cjs +0 -2
- package/dist/adapters/handler-C63rJUUK.cjs +0 -25
- package/dist/adapters/locale-CTNwPVZI.cjs +0 -198
- package/dist/adapters/locale-gU_d1Wja.js +0 -8249
- package/dist/adapters/mcp-transport-C4J4SAcn.cjs +0 -40
- package/dist/adapters/mcp-transport-CVUiifEc.js +0 -579
- package/dist/adapters/openai-6wrBvAnv.cjs +0 -1
- package/dist/adapters/openai-BDwb2u7y.cjs +0 -17
- package/dist/adapters/utils-CkEkU8Bo.cjs +0 -128
- package/dist/client/chunks/DashboardEditModal-6KRE36mm.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-x576-O5p.js.map +0 -1
- package/dist/client/chunks/analysis-builder-zd48FVJO.js +0 -5367
- package/dist/client/chunks/analysis-builder-zd48FVJO.js.map +0 -1
- package/dist/client/chunks/chart-activity-grid-CiHrLH6Y.js.map +0 -1
- package/dist/client/chunks/chart-area-CXFK-Grv.js +0 -450
- package/dist/client/chunks/chart-area-CXFK-Grv.js.map +0 -1
- package/dist/client/chunks/chart-bar-DKXfLoGG.js +0 -271
- package/dist/client/chunks/chart-bar-DKXfLoGG.js.map +0 -1
- package/dist/client/chunks/chart-bubble-DGkTQlxM.js +0 -273
- package/dist/client/chunks/chart-bubble-DGkTQlxM.js.map +0 -1
- package/dist/client/chunks/chart-config-area-Bq_UsW3x.js +0 -101
- package/dist/client/chunks/chart-config-area-Bq_UsW3x.js.map +0 -1
- package/dist/client/chunks/chart-config-bar-_JEGZnAu.js +0 -95
- package/dist/client/chunks/chart-config-bar-_JEGZnAu.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-DJ-dWWXA.js.map +0 -1
- package/dist/client/chunks/chart-config-gauge-DSwC04l0.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-delta-D6BIkHL3.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-number-Bx-V9a62.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-text-CcqC1u-8.js.map +0 -1
- package/dist/client/chunks/chart-config-line-Db3jDsWc.js.map +0 -1
- package/dist/client/chunks/chart-config-pie-DD4SmRTF.js.map +0 -1
- package/dist/client/chunks/chart-config-radar-CC2XAaGr.js.map +0 -1
- package/dist/client/chunks/chart-config-radial-bar-DmxKx1R0.js.map +0 -1
- package/dist/client/chunks/chart-config-tree-map-BI-oQStO.js.map +0 -1
- package/dist/client/chunks/chart-config-waterfall-DSnyixbI.js.map +0 -1
- package/dist/client/chunks/chart-data-table-Cm5jrpaw.js.map +0 -1
- package/dist/client/chunks/chart-funnel-Eke8IPtG.js.map +0 -1
- package/dist/client/chunks/chart-gauge-DeRZNsyl.js +0 -424
- package/dist/client/chunks/chart-gauge-DeRZNsyl.js.map +0 -1
- package/dist/client/chunks/chart-heat-map-C86thSJ4.js +0 -231
- package/dist/client/chunks/chart-heat-map-C86thSJ4.js.map +0 -1
- package/dist/client/chunks/chart-kpi-delta-CxOYD2f1.js +0 -343
- package/dist/client/chunks/chart-kpi-delta-CxOYD2f1.js.map +0 -1
- package/dist/client/chunks/chart-kpi-number-C6gWz-x4.js +0 -322
- package/dist/client/chunks/chart-kpi-number-C6gWz-x4.js.map +0 -1
- package/dist/client/chunks/chart-kpi-text-dDONrhS-.js +0 -149
- package/dist/client/chunks/chart-kpi-text-dDONrhS-.js.map +0 -1
- package/dist/client/chunks/chart-line-r4iWevKZ.js +0 -433
- package/dist/client/chunks/chart-line-r4iWevKZ.js.map +0 -1
- package/dist/client/chunks/chart-markdown-BPW-EAm9.js.map +0 -1
- package/dist/client/chunks/chart-pie-yqH2YVEI.js +0 -172
- package/dist/client/chunks/chart-pie-yqH2YVEI.js.map +0 -1
- package/dist/client/chunks/chart-radar-B-_3v-rE.js +0 -154
- package/dist/client/chunks/chart-radar-B-_3v-rE.js.map +0 -1
- package/dist/client/chunks/chart-radial-bar-C0EgzfAF.js +0 -148
- package/dist/client/chunks/chart-radial-bar-C0EgzfAF.js.map +0 -1
- package/dist/client/chunks/chart-scatter-DZPirzwX.js +0 -255
- package/dist/client/chunks/chart-scatter-DZPirzwX.js.map +0 -1
- package/dist/client/chunks/chart-tree-map-Bi4axCvh.js +0 -298
- package/dist/client/chunks/chart-tree-map-Bi4axCvh.js.map +0 -1
- package/dist/client/chunks/useDirtyStateTracking-B5wCDJSj.js.map +0 -1
- package/dist/server/google-DUlXeeDA.cjs +0 -2
- package/dist/server/openai-6wrBvAnv.cjs +0 -1
- package/dist/server/openai-BDwb2u7y.cjs +0 -17
- /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
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { SecurityContext, SemanticQuery, QueryResult, DatabaseExecutor, Cube, CacheConfig, ExplainOptions, ExplainResult, ExecutionOptions, QueryAnalysis, RLSSetupFn } from './types';
|
|
2
|
+
import { PlanOptimiser } from './logical-plan';
|
|
3
|
+
export declare class QueryExecutor {
|
|
4
|
+
private dbExecutor;
|
|
5
|
+
private queryBuilder;
|
|
6
|
+
private drizzlePlanBuilder;
|
|
7
|
+
private databaseAdapter;
|
|
8
|
+
private comparisonQueryBuilder;
|
|
9
|
+
private funnelQueryBuilder;
|
|
10
|
+
private flowQueryBuilder;
|
|
11
|
+
private retentionQueryBuilder;
|
|
12
|
+
private logicalPlanBuilder;
|
|
13
|
+
private planOptimiser;
|
|
14
|
+
private modeRouter;
|
|
15
|
+
private resultCache;
|
|
16
|
+
private filterCachePreloader;
|
|
17
|
+
private rlsSetup?;
|
|
18
|
+
constructor(dbExecutor: DatabaseExecutor, cacheConfig?: CacheConfig, rlsSetup?: RLSSetupFn, planOptimiser?: PlanOptimiser);
|
|
19
|
+
/**
|
|
20
|
+
* Execute a function within a RLS-configured transaction context.
|
|
21
|
+
* If no rlsSetup function is configured, the function is called directly.
|
|
22
|
+
* Otherwise, opens a transaction, calls rlsSetup to configure RLS, then
|
|
23
|
+
* runs fn with this.dbExecutor replaced by a transaction-scoped executor.
|
|
24
|
+
*
|
|
25
|
+
* Concurrency-safe: the dbExecutor is per-request (created fresh by
|
|
26
|
+
* SemanticLayerCompiler.createQueryExecutor), so reassigning this.dbExecutor
|
|
27
|
+
* only affects this request.
|
|
28
|
+
*/
|
|
29
|
+
private withRLSContext;
|
|
30
|
+
/**
|
|
31
|
+
* Unified query execution method that handles both single and multi-cube queries
|
|
32
|
+
* @param options.skipCache - Skip cache lookup (but still cache the fresh result)
|
|
33
|
+
*/
|
|
34
|
+
execute(cubes: Map<string, Cube>, query: SemanticQuery, securityContext: SecurityContext, options?: ExecutionOptions): Promise<QueryResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Build a logical plan for a query without executing it.
|
|
37
|
+
* Useful for testing, debugging, and plan inspection.
|
|
38
|
+
*/
|
|
39
|
+
buildLogicalPlan(cubes: Map<string, Cube>, query: SemanticQuery, securityContext: SecurityContext): import('./logical-plan').QueryNode;
|
|
40
|
+
/**
|
|
41
|
+
* Analyze planning decisions for a regular query using the same logical
|
|
42
|
+
* planning path as execution and dry-run SQL generation.
|
|
43
|
+
*/
|
|
44
|
+
analyzeQuery(cubes: Map<string, Cube>, query: SemanticQuery, securityContext: SecurityContext): QueryAnalysis;
|
|
45
|
+
/**
|
|
46
|
+
* Legacy interface for single cube queries
|
|
47
|
+
*/
|
|
48
|
+
executeQuery(cube: Cube, query: SemanticQuery, securityContext: SecurityContext): Promise<QueryResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Execute a comparison query with caching support
|
|
51
|
+
* Wraps executeComparisonQuery with cache set logic
|
|
52
|
+
*/
|
|
53
|
+
private executeComparisonQueryWithCache;
|
|
54
|
+
/**
|
|
55
|
+
* Execute a comparison query with multiple date periods
|
|
56
|
+
* Expands compareDateRange into multiple sub-queries and merges results
|
|
57
|
+
*/
|
|
58
|
+
private executeComparisonQuery;
|
|
59
|
+
private buildComparisonExecutionPlan;
|
|
60
|
+
/**
|
|
61
|
+
* Execute an analysis query (funnel/flow/retention) with caching support.
|
|
62
|
+
* Wraps the inner execute callback with cache-set logic; the three analysis
|
|
63
|
+
* modes share identical wrapper behaviour, differing only in which inner
|
|
64
|
+
* execute method they invoke.
|
|
65
|
+
*
|
|
66
|
+
* Cache metadata is intentionally NOT attached here: fresh results across all
|
|
67
|
+
* query modes (regular, comparison, and analysis) uniformly carry no `cache`
|
|
68
|
+
* field — only cache *hits* (handled in execute()) carry cache metadata.
|
|
69
|
+
*/
|
|
70
|
+
private executeAnalysisQueryWithCache;
|
|
71
|
+
/**
|
|
72
|
+
* Execute a funnel analysis query
|
|
73
|
+
*/
|
|
74
|
+
private executeFunnelQuery;
|
|
75
|
+
/**
|
|
76
|
+
* Execute a flow analysis query
|
|
77
|
+
* Produces Sankey diagram data (nodes and links)
|
|
78
|
+
*/
|
|
79
|
+
private executeFlowQuery;
|
|
80
|
+
/**
|
|
81
|
+
* Execute a retention analysis query
|
|
82
|
+
* Calculates cohort-based retention rates
|
|
83
|
+
*/
|
|
84
|
+
private executeRetentionQuery;
|
|
85
|
+
/**
|
|
86
|
+
* Standard (regular/non-comparison) query execution.
|
|
87
|
+
*
|
|
88
|
+
* This is the single core execution path used by both the regular query mode
|
|
89
|
+
* and comparison-mode period sub-queries. It always runs the dev-time
|
|
90
|
+
* security-context validation and propagates planner warnings; the optional
|
|
91
|
+
* `cacheKey` controls whether the fresh result is written to the cache.
|
|
92
|
+
*
|
|
93
|
+
* @param cacheKey - When provided (and a cache provider is configured), the
|
|
94
|
+
* fresh result is written to the cache. Pass `undefined` to skip caching
|
|
95
|
+
* (e.g. comparison period sub-queries cache at the comparison level).
|
|
96
|
+
*/
|
|
97
|
+
private executeStandardQuery;
|
|
98
|
+
/**
|
|
99
|
+
* Create a query context with optional filter cache.
|
|
100
|
+
*/
|
|
101
|
+
private createQueryContext;
|
|
102
|
+
/**
|
|
103
|
+
* Resolve the real database engine type for optimiser passes.
|
|
104
|
+
* Returns the true engine for all 7 supported engines (no collapsing);
|
|
105
|
+
* passes decide for themselves whether to treat e.g. SingleStore like MySQL.
|
|
106
|
+
*/
|
|
107
|
+
private getOptimiserEngineType;
|
|
108
|
+
/**
|
|
109
|
+
* Shared regular-query planning pipeline used by execute, dry-run SQL,
|
|
110
|
+
* and analysis. This is the single source of planning truth.
|
|
111
|
+
*/
|
|
112
|
+
private buildRegularQueryArtifacts;
|
|
113
|
+
/**
|
|
114
|
+
* Validate that all cubes in the query plan have proper security filtering.
|
|
115
|
+
* Emits a warning if a cube's sql() function doesn't return a WHERE clause.
|
|
116
|
+
*
|
|
117
|
+
* Security is critical in multi-tenant applications - this validation helps
|
|
118
|
+
* detect cubes that may leak data across tenants.
|
|
119
|
+
*/
|
|
120
|
+
private validateSecurityContext;
|
|
121
|
+
/**
|
|
122
|
+
* Generate raw SQL for debugging (without execution) - unified approach
|
|
123
|
+
*/
|
|
124
|
+
generateSQL(cube: Cube, query: SemanticQuery, securityContext: SecurityContext): Promise<{
|
|
125
|
+
sql: string;
|
|
126
|
+
params?: any[];
|
|
127
|
+
}>;
|
|
128
|
+
/**
|
|
129
|
+
* Generate raw SQL for multi-cube queries without execution - unified approach
|
|
130
|
+
*/
|
|
131
|
+
generateMultiCubeSQL(cubes: Map<string, Cube>, query: SemanticQuery, securityContext: SecurityContext): Promise<{
|
|
132
|
+
sql: string;
|
|
133
|
+
params?: any[];
|
|
134
|
+
}>;
|
|
135
|
+
/**
|
|
136
|
+
* Generate SQL for a funnel query without execution (dry-run)
|
|
137
|
+
* Returns the actual CTE-based SQL that would be executed
|
|
138
|
+
*/
|
|
139
|
+
dryRunFunnel(cubes: Map<string, Cube>, query: SemanticQuery, securityContext: SecurityContext): Promise<{
|
|
140
|
+
sql: string;
|
|
141
|
+
params?: any[];
|
|
142
|
+
}>;
|
|
143
|
+
/**
|
|
144
|
+
* Generate SQL for a flow query without execution (dry-run)
|
|
145
|
+
* Returns the actual CTE-based SQL that would be executed
|
|
146
|
+
*/
|
|
147
|
+
dryRunFlow(cubes: Map<string, Cube>, query: SemanticQuery, securityContext: SecurityContext): Promise<{
|
|
148
|
+
sql: string;
|
|
149
|
+
params?: any[];
|
|
150
|
+
}>;
|
|
151
|
+
/**
|
|
152
|
+
* Generate SQL for a retention query without execution (dry-run)
|
|
153
|
+
* Returns the actual CTE-based SQL that would be executed
|
|
154
|
+
*/
|
|
155
|
+
dryRunRetention(cubes: Map<string, Cube>, query: SemanticQuery, securityContext: SecurityContext): Promise<{
|
|
156
|
+
sql: string;
|
|
157
|
+
params?: any[];
|
|
158
|
+
}>;
|
|
159
|
+
/**
|
|
160
|
+
* Generic dry-run SQL generator for analysis modes (funnel/flow/retention).
|
|
161
|
+
* The three modes share an identical shape (mode guard → config validation →
|
|
162
|
+
* build query → toSQL()), differing only in which builder/config they use.
|
|
163
|
+
*/
|
|
164
|
+
private dryRunAnalysis;
|
|
165
|
+
/**
|
|
166
|
+
* Execute EXPLAIN on a query to get the execution plan
|
|
167
|
+
* Generates the SQL using the same secure path as execute/generateSQL,
|
|
168
|
+
* then runs EXPLAIN on the database.
|
|
169
|
+
*/
|
|
170
|
+
explainQuery(cubes: Map<string, Cube>, query: SemanticQuery, securityContext: SecurityContext, options?: ExplainOptions): Promise<ExplainResult>;
|
|
171
|
+
/**
|
|
172
|
+
* Generate SQL for any query mode without execution.
|
|
173
|
+
* This is the canonical dry-run SQL entrypoint used by explain/adapters.
|
|
174
|
+
*/
|
|
175
|
+
dryRunSQL(cubes: Map<string, Cube>, query: SemanticQuery, securityContext: SecurityContext): Promise<{
|
|
176
|
+
sql: string;
|
|
177
|
+
params?: any[];
|
|
178
|
+
}>;
|
|
179
|
+
/**
|
|
180
|
+
* Generate SQL using unified approach (works for both single and multi-cube)
|
|
181
|
+
*/
|
|
182
|
+
private generateUnifiedSQL;
|
|
183
|
+
private executeQueryByModeWithCache;
|
|
184
|
+
private generateSqlForMode;
|
|
185
|
+
private generateComparisonSQL;
|
|
186
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
import { DrizzleDatabase, DatabaseExecutor, ExplainOptions, ExplainResult, IndexInfo } from '../types';
|
|
3
|
+
import { DatabaseAdapter } from '../adapters/base-adapter';
|
|
4
|
+
/**
|
|
5
|
+
* Abstract base class for database executors
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class BaseDatabaseExecutor implements DatabaseExecutor {
|
|
8
|
+
db: DrizzleDatabase;
|
|
9
|
+
schema?: any | undefined;
|
|
10
|
+
databaseAdapter: DatabaseAdapter;
|
|
11
|
+
constructor(db: DrizzleDatabase, schema?: any | undefined, engineType?: 'postgres' | 'mysql' | 'sqlite' | 'singlestore' | 'duckdb' | 'databend' | 'snowflake');
|
|
12
|
+
abstract execute<T = any[]>(query: SQL | any, numericFields?: string[]): Promise<T>;
|
|
13
|
+
abstract getEngineType(): 'postgres' | 'mysql' | 'sqlite' | 'singlestore' | 'duckdb' | 'databend' | 'snowflake';
|
|
14
|
+
abstract explainQuery(sqlString: string, params: unknown[], options?: ExplainOptions): Promise<ExplainResult>;
|
|
15
|
+
abstract getTableIndexes(tableNames: string[]): Promise<IndexInfo[]>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
import { DrizzleDatabase, ExplainOptions, ExplainResult, IndexInfo } from '../types';
|
|
3
|
+
import { BaseDatabaseExecutor } from './base-executor';
|
|
4
|
+
export declare class DatabendExecutor extends BaseDatabaseExecutor {
|
|
5
|
+
execute<T = any[]>(query: SQL | any, numericFields?: string[]): Promise<T>;
|
|
6
|
+
/**
|
|
7
|
+
* Extract SQL string and params from a query object for error logging
|
|
8
|
+
*/
|
|
9
|
+
private extractSqlFromQuery;
|
|
10
|
+
/**
|
|
11
|
+
* Convert numeric string fields to numbers (only for measure fields)
|
|
12
|
+
*/
|
|
13
|
+
private convertNumericFields;
|
|
14
|
+
/**
|
|
15
|
+
* Coerce a value to a number if it represents a numeric type
|
|
16
|
+
*/
|
|
17
|
+
private coerceToNumber;
|
|
18
|
+
getEngineType(): 'databend';
|
|
19
|
+
/**
|
|
20
|
+
* Execute EXPLAIN on a SQL query to get the execution plan
|
|
21
|
+
* Databend supports EXPLAIN and EXPLAIN ANALYZE
|
|
22
|
+
*/
|
|
23
|
+
explainQuery(sqlString: string, params: unknown[], options?: ExplainOptions): Promise<ExplainResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Get existing indexes for the specified tables
|
|
26
|
+
* Databend uses system tables for index information
|
|
27
|
+
*/
|
|
28
|
+
getTableIndexes(tableNames: string[]): Promise<IndexInfo[]>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Factory function for creating Databend executors
|
|
32
|
+
*/
|
|
33
|
+
export declare function createDatabendExecutor(db: DrizzleDatabase, schema?: any): DatabendExecutor;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
import { DrizzleDatabase, ExplainOptions, ExplainResult, IndexInfo } from '../types';
|
|
3
|
+
import { BaseDatabaseExecutor } from './base-executor';
|
|
4
|
+
export declare class DuckDBExecutor extends BaseDatabaseExecutor {
|
|
5
|
+
execute<T = any[]>(query: SQL | any, numericFields?: string[]): Promise<T>;
|
|
6
|
+
/**
|
|
7
|
+
* Extract SQL string and params from a query object for error logging
|
|
8
|
+
*/
|
|
9
|
+
private extractSqlFromQuery;
|
|
10
|
+
/**
|
|
11
|
+
* Convert numeric string fields to numbers (only for measure fields)
|
|
12
|
+
*/
|
|
13
|
+
private convertNumericFields;
|
|
14
|
+
/**
|
|
15
|
+
* Coerce a value to a number if it represents a numeric type
|
|
16
|
+
*/
|
|
17
|
+
private coerceToNumber;
|
|
18
|
+
getEngineType(): 'duckdb';
|
|
19
|
+
/**
|
|
20
|
+
* Execute EXPLAIN on a SQL query to get the execution plan
|
|
21
|
+
* DuckDB supports EXPLAIN and EXPLAIN ANALYZE
|
|
22
|
+
*/
|
|
23
|
+
explainQuery(sqlString: string, params: unknown[], options?: ExplainOptions): Promise<ExplainResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Get existing indexes for the specified tables
|
|
26
|
+
* DuckDB uses duckdb_indexes() table function
|
|
27
|
+
*/
|
|
28
|
+
getTableIndexes(tableNames: string[]): Promise<IndexInfo[]>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Factory function for creating DuckDB executors
|
|
32
|
+
*/
|
|
33
|
+
export declare function createDuckDBExecutor(db: DrizzleDatabase, schema?: any): DuckDBExecutor;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
/**
|
|
3
|
+
* Rebuild a parameterized SQL string into a Drizzle SQL object with `params`
|
|
4
|
+
* bound as real driver parameters.
|
|
5
|
+
*
|
|
6
|
+
* @param sqlString - SQL produced by Drizzle's `.toSQL()`, containing either `?`
|
|
7
|
+
* placeholders (mysql/sqlite/singlestore/snowflake) or `$n` placeholders
|
|
8
|
+
* (postgres/duckdb/databend)
|
|
9
|
+
* @param params - Bound parameter values, in order
|
|
10
|
+
* @param style - Placeholder style used by `sqlString`
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildBoundSql(sqlString: string, params: unknown[], style: 'question' | 'dollar'): SQL;
|
|
13
|
+
/**
|
|
14
|
+
* Normalize raw MySQL EXPLAIN result rows into the column shape the MySQL parser
|
|
15
|
+
* expects. Extracted from MySQLExecutor.explainQuery to keep that method simple.
|
|
16
|
+
*/
|
|
17
|
+
export declare function normalizeMySQLExplainRows(result: unknown): any[];
|
|
18
|
+
/**
|
|
19
|
+
* Normalize raw SQLite EXPLAIN QUERY PLAN result rows into the column shape the
|
|
20
|
+
* SQLite parser expects. Extracted from SQLiteExecutor.explainQuery.
|
|
21
|
+
*/
|
|
22
|
+
export declare function normalizeSQLiteExplainRows(result: unknown): any[];
|
|
23
|
+
/**
|
|
24
|
+
* Extract the textual plan lines from PostgreSQL EXPLAIN result rows. Handles the
|
|
25
|
+
* differing column-name casing across drivers. Extracted from
|
|
26
|
+
* PostgresExecutor.explainQuery.
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractPostgresExplainLines(rows: any[]): string[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DrizzleDatabase, DatabaseExecutor } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Database executors for different database engines
|
|
4
|
+
* Handles SQL execution with proper type coercion
|
|
5
|
+
*/
|
|
6
|
+
export { BaseDatabaseExecutor } from './base-executor';
|
|
7
|
+
export { PostgresExecutor, createPostgresExecutor } from './postgres-executor';
|
|
8
|
+
export { MySQLExecutor, createMySQLExecutor } from './mysql-executor';
|
|
9
|
+
export { SQLiteExecutor, createSQLiteExecutor } from './sqlite-executor';
|
|
10
|
+
export { SingleStoreExecutor, createSingleStoreExecutor } from './singlestore-executor';
|
|
11
|
+
export { DuckDBExecutor, createDuckDBExecutor } from './duckdb-executor';
|
|
12
|
+
export { DatabendExecutor, createDatabendExecutor } from './databend-executor';
|
|
13
|
+
export { SnowflakeExecutor, createSnowflakeExecutor } from './snowflake-executor';
|
|
14
|
+
/**
|
|
15
|
+
* Auto-detect database type and create appropriate executor
|
|
16
|
+
* @param db - Drizzle database instance
|
|
17
|
+
* @param schema - Optional schema for type inference
|
|
18
|
+
* @param engineType - Optional explicit engine type override
|
|
19
|
+
* @returns Appropriate database executor
|
|
20
|
+
*/
|
|
21
|
+
export declare function createDatabaseExecutor(db: DrizzleDatabase, schema?: any, engineType?: 'postgres' | 'mysql' | 'sqlite' | 'singlestore' | 'duckdb' | 'databend' | 'snowflake'): DatabaseExecutor;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
import { DrizzleDatabase, ExplainOptions, ExplainResult, IndexInfo } from '../types';
|
|
3
|
+
import { BaseDatabaseExecutor } from './base-executor';
|
|
4
|
+
export declare class MySQLExecutor extends BaseDatabaseExecutor {
|
|
5
|
+
execute<T = any[]>(query: SQL | any, numericFields?: string[]): Promise<T>;
|
|
6
|
+
/**
|
|
7
|
+
* Convert numeric string fields to numbers (measure fields + numeric dimensions)
|
|
8
|
+
*/
|
|
9
|
+
private convertNumericFields;
|
|
10
|
+
/**
|
|
11
|
+
* Coerce a value to a number if it represents a numeric type
|
|
12
|
+
*/
|
|
13
|
+
private coerceToNumber;
|
|
14
|
+
getEngineType(): 'mysql' | 'singlestore';
|
|
15
|
+
/**
|
|
16
|
+
* Execute EXPLAIN on a SQL query to get the execution plan
|
|
17
|
+
*/
|
|
18
|
+
explainQuery(sqlString: string, params: unknown[], options?: ExplainOptions): Promise<ExplainResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Get existing indexes for the specified tables
|
|
21
|
+
*/
|
|
22
|
+
getTableIndexes(tableNames: string[]): Promise<IndexInfo[]>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Factory function for creating MySQL executors
|
|
26
|
+
*/
|
|
27
|
+
export declare function createMySQLExecutor(db: DrizzleDatabase, schema?: any): MySQLExecutor;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
import { DrizzleDatabase, ExplainOptions, ExplainResult, IndexInfo } from '../types';
|
|
3
|
+
import { BaseDatabaseExecutor } from './base-executor';
|
|
4
|
+
export declare class PostgresExecutor extends BaseDatabaseExecutor {
|
|
5
|
+
execute<T = any[]>(query: SQL | any, numericFields?: string[]): Promise<T>;
|
|
6
|
+
/**
|
|
7
|
+
* Convert numeric string fields to numbers (only for measure fields)
|
|
8
|
+
*/
|
|
9
|
+
private convertNumericFields;
|
|
10
|
+
/**
|
|
11
|
+
* Coerce a value to a number if it represents a numeric type
|
|
12
|
+
*/
|
|
13
|
+
private coerceToNumber;
|
|
14
|
+
getEngineType(): 'postgres';
|
|
15
|
+
/**
|
|
16
|
+
* Execute EXPLAIN on a SQL query to get the execution plan
|
|
17
|
+
*/
|
|
18
|
+
explainQuery(sqlString: string, params: unknown[], options?: ExplainOptions): Promise<ExplainResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Get existing indexes for the specified tables
|
|
21
|
+
*/
|
|
22
|
+
getTableIndexes(tableNames: string[]): Promise<IndexInfo[]>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Factory function for creating PostgreSQL executors
|
|
26
|
+
*/
|
|
27
|
+
export declare function createPostgresExecutor(db: DrizzleDatabase, schema?: any): PostgresExecutor;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DrizzleDatabase } from '../types';
|
|
2
|
+
import { MySQLExecutor } from './mysql-executor';
|
|
3
|
+
export declare class SingleStoreExecutor extends MySQLExecutor {
|
|
4
|
+
getEngineType(): 'singlestore';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Factory function for creating SingleStore executors
|
|
8
|
+
*/
|
|
9
|
+
export declare function createSingleStoreExecutor(db: DrizzleDatabase, schema?: any): SingleStoreExecutor;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
import { DrizzleDatabase, ExplainOptions, ExplainResult, IndexInfo } from '../types';
|
|
3
|
+
import { BaseDatabaseExecutor } from './base-executor';
|
|
4
|
+
export declare class SnowflakeExecutor extends BaseDatabaseExecutor {
|
|
5
|
+
execute<T = any[]>(query: SQL | any, numericFields?: string[]): Promise<T>;
|
|
6
|
+
/**
|
|
7
|
+
* Extract SQL string and params from a query object for error logging
|
|
8
|
+
*/
|
|
9
|
+
private extractSqlFromQuery;
|
|
10
|
+
/**
|
|
11
|
+
* Convert numeric string fields to numbers (only for measure fields)
|
|
12
|
+
*/
|
|
13
|
+
private convertNumericFields;
|
|
14
|
+
/**
|
|
15
|
+
* Coerce a value to a number if it represents a numeric type
|
|
16
|
+
*/
|
|
17
|
+
private coerceToNumber;
|
|
18
|
+
getEngineType(): 'snowflake';
|
|
19
|
+
/**
|
|
20
|
+
* Execute EXPLAIN on a SQL query to get the execution plan
|
|
21
|
+
* Snowflake supports EXPLAIN and EXPLAIN USING TEXT/JSON/TABULAR
|
|
22
|
+
*/
|
|
23
|
+
explainQuery(sqlString: string, params: unknown[], options?: ExplainOptions): Promise<ExplainResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Get existing indexes for the specified tables
|
|
26
|
+
* Snowflake doesn't use traditional indexes (it uses micro-partitioning)
|
|
27
|
+
*/
|
|
28
|
+
getTableIndexes(_tableNames: string[]): Promise<IndexInfo[]>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Factory function for creating Snowflake executors
|
|
32
|
+
*/
|
|
33
|
+
export declare function createSnowflakeExecutor(db: DrizzleDatabase, schema?: any): SnowflakeExecutor;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SQL } from 'drizzle-orm';
|
|
2
|
+
import { DrizzleDatabase, ExplainOptions, ExplainResult, IndexInfo } from '../types';
|
|
3
|
+
import { BaseDatabaseExecutor } from './base-executor';
|
|
4
|
+
export declare class SQLiteExecutor extends BaseDatabaseExecutor {
|
|
5
|
+
execute<T = any[]>(query: SQL | any, numericFields?: string[]): Promise<T>;
|
|
6
|
+
/**
|
|
7
|
+
* Convert numeric string fields to numbers (only for measure fields)
|
|
8
|
+
*/
|
|
9
|
+
private convertNumericFields;
|
|
10
|
+
/**
|
|
11
|
+
* Coerce a value to a number if it represents a numeric type
|
|
12
|
+
*/
|
|
13
|
+
private coerceToNumber;
|
|
14
|
+
getEngineType(): 'sqlite';
|
|
15
|
+
/**
|
|
16
|
+
* Execute EXPLAIN QUERY PLAN on a SQL query to get the execution plan
|
|
17
|
+
* Note: SQLite doesn't support EXPLAIN ANALYZE
|
|
18
|
+
*/
|
|
19
|
+
explainQuery(sqlString: string, params: unknown[], _options?: ExplainOptions): Promise<ExplainResult>;
|
|
20
|
+
/**
|
|
21
|
+
* Get existing indexes for the specified tables
|
|
22
|
+
*/
|
|
23
|
+
getTableIndexes(tableNames: string[]): Promise<IndexInfo[]>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Factory function for creating SQLite executors
|
|
27
|
+
*/
|
|
28
|
+
export declare function createSQLiteExecutor(db: DrizzleDatabase, schema?: any): SQLiteExecutor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ExplainResult } from '../types/executor';
|
|
2
|
+
/**
|
|
3
|
+
* Parse Databend EXPLAIN output
|
|
4
|
+
*
|
|
5
|
+
* Databend EXPLAIN output is typically indented text showing the query plan tree.
|
|
6
|
+
* Example:
|
|
7
|
+
* "Filter"
|
|
8
|
+
* "├── filters: [employees.organisation_id = 1]"
|
|
9
|
+
* "├── TableScan"
|
|
10
|
+
* "│ ├── table: employees"
|
|
11
|
+
* "│ ├── estimated rows: 1000"
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseDatabendExplain(rawOutput: string[], sqlQuery: {
|
|
14
|
+
sql: string;
|
|
15
|
+
params?: unknown[];
|
|
16
|
+
}): ExplainResult;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ExplainResult } from '../types/executor';
|
|
2
|
+
/**
|
|
3
|
+
* Parse DuckDB EXPLAIN output
|
|
4
|
+
*
|
|
5
|
+
* Example DuckDB EXPLAIN output:
|
|
6
|
+
* "┌───────────────────────────┐"
|
|
7
|
+
* "│ EXPLANATION OF │"
|
|
8
|
+
* "│ QUERY PLAN │"
|
|
9
|
+
* "└───────────────────────────┘"
|
|
10
|
+
* "┌─────────────────────────────────────────────────────────────────────┐"
|
|
11
|
+
* "│ QUERY PLAN │"
|
|
12
|
+
* "├─────────────────────────────────────────────────────────────────────┤"
|
|
13
|
+
* "│ HASH_JOIN │"
|
|
14
|
+
* "│ ├──SEQ_SCAN employees │"
|
|
15
|
+
* "│ │ (cost=100.0 rows=1000) │"
|
|
16
|
+
* "│ └──SEQ_SCAN departments │"
|
|
17
|
+
* "│ (cost=50.0 rows=500) │"
|
|
18
|
+
* "└─────────────────────────────────────────────────────────────────────┘"
|
|
19
|
+
*
|
|
20
|
+
* Or simpler format:
|
|
21
|
+
* "HASH_JOIN"
|
|
22
|
+
* "├──SEQ_SCAN employees"
|
|
23
|
+
* "└──SEQ_SCAN departments"
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseDuckDBExplain(rawOutput: string[], sqlQuery: {
|
|
26
|
+
sql: string;
|
|
27
|
+
params?: unknown[];
|
|
28
|
+
}): ExplainResult;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExplainOperation } from '../types/executor';
|
|
2
|
+
/** Stack entry tracking an operation and its indentation depth. */
|
|
3
|
+
export interface ExplainStackEntry {
|
|
4
|
+
indent: number;
|
|
5
|
+
op: ExplainOperation;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Insert an operation into the hierarchical tree using the indentation stack.
|
|
9
|
+
*
|
|
10
|
+
* Pops the stack until the top entry has strictly less indentation than the
|
|
11
|
+
* incoming operation, then attaches the operation either as a root (pushed to
|
|
12
|
+
* `operations`) or as a child of the current stack top. Finally pushes the
|
|
13
|
+
* operation onto the stack so subsequent deeper lines can nest under it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pushOperationToTree(stack: ExplainStackEntry[], operations: ExplainOperation[], operation: ExplainOperation, indent: number): void;
|
|
16
|
+
/**
|
|
17
|
+
* Count indentation level based on tree drawing characters and spaces.
|
|
18
|
+
* Used by DuckDB and Databend parsers.
|
|
19
|
+
*/
|
|
20
|
+
export declare function countTreeIndent(line: string): number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXPLAIN plan parsers
|
|
3
|
+
* Normalize raw EXPLAIN output from different databases to a common format
|
|
4
|
+
*/
|
|
5
|
+
export { parsePostgresExplain } from './postgres-parser';
|
|
6
|
+
export { parseMySQLExplain } from './mysql-parser';
|
|
7
|
+
export { parseSQLiteExplain } from './sqlite-parser';
|
|
8
|
+
export { parseDuckDBExplain } from './duckdb-parser';
|
|
9
|
+
export type { ExplainOperation, ExplainResult, ExplainSummary, ExplainOptions } from '../types/executor';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ExplainResult } from '../types/executor';
|
|
2
|
+
/**
|
|
3
|
+
* MySQL EXPLAIN row structure
|
|
4
|
+
* Standard columns returned by EXPLAIN
|
|
5
|
+
*/
|
|
6
|
+
interface MySQLExplainRow {
|
|
7
|
+
id: number;
|
|
8
|
+
select_type: string;
|
|
9
|
+
table: string | null;
|
|
10
|
+
partitions: string | null;
|
|
11
|
+
type: string;
|
|
12
|
+
possible_keys: string | null;
|
|
13
|
+
key: string | null;
|
|
14
|
+
key_len: string | null;
|
|
15
|
+
ref: string | null;
|
|
16
|
+
rows: number;
|
|
17
|
+
filtered: number;
|
|
18
|
+
Extra: string | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parse MySQL EXPLAIN output
|
|
22
|
+
*
|
|
23
|
+
* MySQL EXPLAIN returns rows with columns:
|
|
24
|
+
* id, select_type, table, partitions, type, possible_keys, key, key_len, ref, rows, filtered, Extra
|
|
25
|
+
*
|
|
26
|
+
* The 'type' column indicates access method:
|
|
27
|
+
* - ALL: Full table scan (like Seq Scan)
|
|
28
|
+
* - index: Full index scan
|
|
29
|
+
* - range: Index range scan
|
|
30
|
+
* - ref: Index lookup using non-unique index
|
|
31
|
+
* - eq_ref: Index lookup using unique index
|
|
32
|
+
* - const: Single row lookup
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseMySQLExplain(rows: MySQLExplainRow[], sqlQuery: {
|
|
35
|
+
sql: string;
|
|
36
|
+
params?: unknown[];
|
|
37
|
+
}): ExplainResult;
|
|
38
|
+
export {};
|
|
@@ -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 {};
|