Skip to main content

SQLTree

The SQLTree widget provides a hierarchical tree selector that executes SQL queries to retrieve database entities and displays them in a parent-child tree structure in your Atlan app. It supports filtering with include/exclude patterns, single or multiple selection modes, and parent-child relationships between database objects. Use the SQLTree widget when you need users to select specific database entities like schemas, tables, or other hierarchical data structures.

SQLTree widget screenshot

How it works

The SQLTree widget:

  • Executes SQL queries on the connected database
  • Displays query results in a hierarchical tree structure
  • Supports parent-child relationships between database objects
  • Supports filtering with include/exclude patterns
  • Supports single or multiple selection modes

Props

The SQLTree widget uses common widget properties for configuration along with specific SQL query properties. For more information, see Widget properties.

credentialRequired

Reference to the credential configuration that contains database connection details for executing SQL queries.

Type: string

sqlRequired

SQL query to execute against the connected database. Results are displayed in the hierarchical tree structure.

Type: string

multipleOptional

Enables multiple selection mode. When true, users can select multiple items from the tree; otherwise, only single selection is allowed.

Type: boolean

dependentConnectionFieldOptional

Field name containing connection information that the SQLTree depends on for dynamic credential resolution.

Type: string

schemaIncludePatternOptional

Regex pattern to filter schemas. Only schemas matching this pattern will be included in the tree results.

Type: string

schemaExcludePatternOptional

Regex pattern to exclude schemas. Schemas matching this pattern will be filtered out from the tree results.

Type: string

databaseIncludePatternOptional

Regex pattern to filter databases. Only databases matching this pattern will be included in the tree results.

Type: string

databaseExcludePatternOptional

Regex pattern to exclude databases. Databases matching this pattern will be filtered out from the tree results.

Type: string

additionalPropertiesToIncludeInCredentialBodyOptional

Array of additional property names to include in the credential request body when making database connections.

Type: string[]

How to use

The SQLTree widget is configured with SQL queries and filtering patterns. In the example below, the widget executes a schema query and applies exclusion patterns to filter out system schemas:

{
"exclude-filter": {
"type": "object",
"additionalProperties": {
"type": "array"
},
"ui": {
"widget": "sqltree",
"sql": "show atlan schemas",
"credential": "credential-guid",
"schemaExcludePattern": [
"pg_*",
"information_*"
],
"label": "Exclude Metadata",
"description": "Selected databases and schemas wont be extracted.",
"grid": 4
}
}
}
  • Credential - Use for secure credential storage referenced by SQLTree queries

See also

  • Widget properties - provides detailed information about common properties shared across all widgets.

Need help

If you face any issues or need help with SQLTree widget configuration, contact Atlan support by submitting a support request.