Data Sources
DB-GPT connects to a wide range of data sources, enabling natural language interaction with your databases, spreadsheets, and data warehouses.
Supported data sourcesâ
| Data Source | Type | Status |
|---|---|---|
| SQLite | Relational | Built-in (default) |
| MySQL | Relational | Supported |
| PostgreSQL | Relational | Supported |
| ClickHouse | OLAP | Supported |
| DuckDB | Analytical | Supported |
| MSSQL | Relational | Supported |
| Oracle | Relational | Supported |
| Excel | Spreadsheet | Supported |
| CSV | Flat file | Supported |
How it worksâ
- User asks a question in natural language
- Text2SQL engine analyzes the question and linked database schema
- SQL is generated based on the question context
- Database executes the query
- Result is formatted and returned (optionally with charts)
Adding a data sourceâ
Via Web UIâ
- Open the DB-GPT Web UI
- Go to Data Sources in the sidebar
- Click Add Data Source
- Select the database type and fill in connection details
- Test the connection and save
Via configurationâ
Data source connections can also be configured in the TOML config file or managed through the REST API.
Text2SQLâ
DB-GPT excels at converting natural language to SQL queries:
- Schema linking â Automatically maps natural language terms to table/column names
- Multi-turn conversation â Refine queries through follow-up questions
- Chart generation â Visualize query results as charts and dashboards
- Fine-tuning â Optimize Text2SQL accuracy for your specific domain
tip
For best Text2SQL results, ensure your database tables and columns have descriptive names and comments.
What's nextâ
- Chat DB â Chat with your database
- Chat Excel â Chat with Excel files
- Chat Dashboard â Build data dashboards
- Datasource Integrations â Install additional connectors
- Connections Module â Deep dive into data source management