Esc
Documentation
On this page

Props

PropTypeDefaultDescription
language requiredstringNoneSyntax language
valuestringNoneInitial query text
action requiredAnyActionDefinition | ActionReference | stringNoneAction to execute the query
database{ source: DataSource; initialValue?: string; label?: string; }NoneDatabase selection for the editor, with the available databases and the current one
explorerQueryEditorExplorerPropsNoneTree explorer sidebar
omitDatabaseFromSqlbooleanNoneWrite 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;
}

View the source on GitHub