Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

666 B
Raw Blame
import { type IStandaloneCodeEditor } from "@/components/monaco/types";

// Plain mutable holders — only ever read/written imperatively (no React
// subscription), so a `{ value }` object is enough.
export const activeSQLEditorRef: { value: IStandaloneCodeEditor | undefined } =
  {
    value: undefined,
  };

/**
 * Tracks the live "active statement" — Monaco's delimited statement under
 * the cursor, or the full editor content as fallback. The React
 * `SQLEditor` writes here via `onActiveContentChange`; the React
 * `EditorMain` reads it when the toolbar's "Run" button is pressed.
 */
export const activeStatementRef: { value: string } = { value: "" };