+ Expandir script con {commands.expandScript.keys}
+
+ {entries.length > 0 &&
+ {entries.map((entry, index) => (
+ -
+
+
+ ))}
+
}
+
+
+ );
+}
diff --git a/app/src/components/CommandConsole.tsx b/app/src/components/CommandConsole.tsx
index 7e4db23..878d4fe 100644
--- a/app/src/components/CommandConsole.tsx
+++ b/app/src/components/CommandConsole.tsx
@@ -1,5 +1,6 @@
import { useEffect, useLayoutEffect, useRef, useState } from "react";
import { api } from "../api";
+import { scriptReplacement } from "../autoReplace";
import { commands, formatKeys, matches } from "../keymap";
import { splitScript } from "../sqlScript";
import { describeError, type CompletionObject } from "../types";
@@ -249,6 +250,20 @@ export function CommandConsole({ sessionId, tabPrefix, active, lines, running, a
}
return;
}
+ if (!event.nativeEvent.isComposing && matches(event, commands.expandScript.keys!)) {
+ const input = event.currentTarget;
+ const at = input.selectionStart;
+ const replacement = at === input.selectionEnd
+ ? scriptReplacement(input.value.slice(0, at), input.value.slice(at)) : null;
+ if (replacement) {
+ event.preventDefault();
+ input.setRangeText(replacement.script, at - replacement.length, at, "end");
+ setPrompt(input.value);
+ setChoice(undefined);
+ setDismissed(false);
+ }
+ return;
+ }
if ((commandLines.length || (prompt && !candidates.length)) && event.key === "Escape") {
event.preventDefault();
event.stopPropagation();
diff --git a/app/src/components/ObjectBrowser.tsx b/app/src/components/ObjectBrowser.tsx
index 9367d4a..8822616 100644
--- a/app/src/components/ObjectBrowser.tsx
+++ b/app/src/components/ObjectBrowser.tsx
@@ -1,4 +1,4 @@
-import { useCallback, useEffect, useId, useMemo, useRef, useState, type ComponentType, type KeyboardEvent } from "react";
+import { useCallback, useEffect, useMemo, useRef, useState, type ComponentType, type KeyboardEvent } from "react";
import { defaultRangeExtractor, useVirtualizer } from "@tanstack/react-virtual";
import {
ArrowsClockwise,
@@ -48,6 +48,7 @@ import { objectMenuItems, type InspectMode } from "../objectMenu";
import { createDraft, dropDraft, type DraftAction } from "../objectDraft";
import { describeError, type ActiveConnection, type ObjectInfo, type ObjectType, type Scope } from "../types";
import { ContextMenu, type ContextItem } from "./ContextMenu";
+import { ToolsDialog } from "./ToolsDialog";
import "./ObjectBrowser.css";
const CODE = "var(--fn)";
@@ -115,9 +116,85 @@ interface Props {
onInspect?: (object: ObjectInfo, mode: InspectMode) => void;
onDraft?: (action: DraftAction, type: ObjectType, object?: ObjectInfo) => void;
onTest?: (o: ObjectInfo, x: number, y: number) => void;
+ onSearchSchema?: () => void;
+ onStatementHistory?: () => void;
}
-export function ObjectBrowser({ connection, onOpenObject, onConnectionLost, refreshKey, onNotice, onQueryData, onEditData, onExportData, onInspect, onDraft, onTest }: Props) {
+export function SchemaSearch({ connection, close, open, onConnectionLost }: {
+ connection: ActiveConnection;
+ close: () => void;
+ open: (object: ObjectInfo) => void;
+ onConnectionLost: () => void;
+}) {
+ const [name, setName] = useState("");
+ const [type, setType] = useState