MCPcopy Create free account
hub / github.com/bytebase/bytebase / useSQLEditorFeature

Function useSQLEditorFeature

frontend/src/react/hooks/useSQLEditorBridge.ts:32–38  ·  view source on GitHub ↗
(feature: PlanFeature)

Source from the content-addressed store, hash-verified

30 * having already triggered `loadSubscription`.
31 */
32export const useSQLEditorFeature = (feature: PlanFeature): boolean => {
33 const loadSubscription = useAppStore((s) => s.loadSubscription);
34 useEffect(() => {
35 void loadSubscription();
36 }, [loadSubscription]);
37 return useAppStore((s) => s.hasFeature(feature));
38};
39
40// Mirrors the Pinia `formatQueryDataPolicy` helper: normalizes
41// `maximumResultRows` so `-1`/`0` (= unlimited) becomes `Number.MAX_VALUE`,

Callers 3

AccessPaneFunction · 0.90
ConnectionPaneInnerFunction · 0.90
EnvironmentLabelFunction · 0.90

Calls 1

useAppStoreFunction · 0.50

Tested by

no test coverage detected