@sqlrooms/sql-editor / SqlCodeMirrorEditorProps
Interface: SqlCodeMirrorEditorProps
Extends
Omit<CodeMirrorEditorProps,"extensions">
Properties
className?
optionalclassName?:string
CSS class name for the editor container
Inherited from
Omit.className
value?
optionalvalue?:string
The content to display in the editor
Inherited from
Omit.value
readOnly?
optionalreadOnly?:boolean
Whether the editor should be in read-only mode
Inherited from
Omit.readOnly
onChange?
optionalonChange?: (value) =>void
Callback when the editor content changes
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
void
Inherited from
Omit.onChange
onMount?
optionalonMount?: (view) =>void
Callback when the editor view is mounted - provides access to EditorView instance
Parameters
| Parameter | Type |
|---|---|
view | EditorView |
Returns
void
Inherited from
Omit.onMount
onValidate?
optionalonValidate?: (diagnostics) =>void
Callback when lint diagnostics change (validation errors/warnings)
Parameters
| Parameter | Type |
|---|---|
diagnostics | Diagnostic[] |
Returns
void
Inherited from
Omit.onValidate
options?
optionaloptions?:CodeMirrorEditorOptions
Additional configuration options
Inherited from
Omit.options
dialect?
optionaldialect?:"duck-db"
SQL dialect for syntax highlighting and completions
connector?
optionalconnector?:DuckDbConnector
Connector for dynamic function suggestions TODO: change to generic connector interface to support multiple dialects
tableSchemas?
optionaltableSchemas?:DataTable[]
Table schemas for autocompletion and hover tooltips
getLatestSchemas?
optionalgetLatestSchemas?: () =>object
Callback to get the latest table schemas
Returns
object
| Name | Type |
|---|---|
tableSchemas | DataTable[] |
onRunQuery?
optionalonRunQuery?: (query) =>void
Callback when Cmd+Enter is pressed (selected text or full document)
Parameters
| Parameter | Type |
|---|---|
query | string |
Returns
void
