Datasource SQL
Overview
The Datasource Selector in AI Studio allows you to connect to pre-configured databases and switch seamlessly between them. Each datasource may have different schemas, SQL dialects, and performance characteristics.
Selecting a Datasource
Accessing the Datasource Selector
The datasource dropdown is located at the top of the AI Studio interface, above the SQL editor tabs.

Choosing a Datasource
- Click the datasource dropdown menu
- Browse available datasources
- Click to select your target database
- All subsequent queries will execute against this datasource
Visual Indicator: The currently selected datasource is always visible in the dropdown, ensuring you know which database you're querying.

Example: Working with Trino DataSource
- Click the Datasource dropdown.
- Select Trino datasource from the list.
- The SQL editor and AI assistant will now operate in the context of the Trino database.
- Run queries or ask the AI assistant for help with Trino datasource.
- Trino queries differ from other databases (e.g., PostgreSQL) due to SQL dialect differences.
- The catalog and schema should be mentioned in the queries.
- Using Trino, you can query data from multiple sources (e.g., MySQL, PostgreSQL) and even combine them.
Example Query for Trino:
SELECT
ms.sport_type_name,
ps.description,
ms.long_name AS "sport_league"
FROM mysql.quickstart.sport_league ms
JOIN postgresql.public.sport_type ps
ON ms.sport_type_name = ps.name;
In this example query, we can see that we are querying data from two different databases - MySQL and PostgreSQL using Trino as a datasource.

Working with Multiple Datasources
Switching Between Datasources
You can change datasources at any time without losing your work in the editor tabs.
When you switch datasources:
- Existing SQL code in tabs remains unchanged
- Query execution targets the newly selected datasource
- AI assistant updates to use the new schema context
- Previous result sets remain visible
Multi-Tab Workflow
Leverage multiple tabs to work with different datasources simultaneously:
- Tab 1: Connect to Production DB, run query
- Tab 2: Switch to Staging DB, test modifications
- Tab 3: Connect to Analytics DB, create report
Datasource Configuration
Pre-Configured Datasources
Datasources displayed in the dropdown are pre-configured by your DataDios administrator.
Typical datasources include:
- Production databases
- Staging/development environments
- Data warehouses
- Analytics databases
- Backup/archive databases
Datasource Metadata
Each datasource may include:
- Database type (MySQL, PostgreSQL, etc.)
Note: Datasource connection settings are managed at the platform level and not configurable within AI Studio.