QueryEditor
Query editor with explorer sidebar.
On this page
Props
| Prop | Type | Default | Description |
|---|---|---|---|
language required | string | None | Syntax language |
value | string | None | Initial query text |
action required | AnyActionDefinition | ActionReference | string | None | Action to execute the query |
database | {
source: DataSource;
initialValue?: string;
label?: string;
} | None | Database selection for the editor, with the available databases and the current one |
explorer | QueryEditorExplorerProps | None | Tree explorer sidebar |
omitDatabaseFromSql | boolean | None | Write table names as schema.table without the database prefix, as PostgreSQL expects |
Example
ts
QueryEditor({
language: "sql",
value: "SELECT 1",
action: executeQuery(),
explorer: { source: tree(), nameField: "name" },
})Supporting types
QueryEditorExplorerProps
export interface QueryEditorExplorerProps {
source: DataSource;
nameField?: string;
typeField?: string;
children?: QueryEditorExplorerProps;
}QueryExplorerDocument
export interface QueryExplorerDocument {
source: ResourceReference;
nameField?: string;
typeField?: string;
children?: QueryExplorerDocument;
}