Data Source Registration
Data sources are the connection points between external databases and the MATIH catalog. The DataSourceController handles registration, configuration, and lifecycle management of data source connections.
Register a Data Source
POST /api/v1/datasourcescurl -X POST "http://localhost:8086/api/v1/datasources" \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000" \
-d '{
"name": "Production PostgreSQL",
"type": "postgresql",
"connectionConfig": {
"host": "prod-db.internal",
"port": 5432,
"database": "analytics",
"authType": "password"
},
"description": "Production analytics database"
}'Response (201 Created)
{
"id": "ds-003",
"tenantId": "550e8400-...",
"name": "Production PostgreSQL",
"type": "postgresql",
"active": true,
"createdAt": "2026-01-15T10:30:00Z"
}List Data Sources
GET /api/v1/datasources?page={page}&size={size}curl "http://localhost:8086/api/v1/datasources?page=0&size=20" \
-H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000"Get Data Source
GET /api/v1/datasources/{id}Update Data Source
PUT /api/v1/datasources/{id}curl -X PUT "http://localhost:8086/api/v1/datasources/ds-003" \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000" \
-d '{
"name": "Production PostgreSQL (Updated)",
"description": "Updated connection details"
}'Delete Data Source
DELETE /api/v1/datasources/{id}Returns 204 No Content on success.
Supported Data Source Types
| Type | Key | Description |
|---|---|---|
| PostgreSQL | postgresql | PostgreSQL 12+ |
| MySQL | mysql | MySQL 8.0+ |
| Snowflake | snowflake | Snowflake Data Cloud |
| BigQuery | bigquery | Google BigQuery |
| Redshift | redshift | Amazon Redshift |
| Trino | trino | Trino (Presto) distributed SQL |
| ClickHouse | clickhouse | ClickHouse OLAP |
| Delta Lake | deltalake | Delta Lake on object storage |
| Iceberg | iceberg | Apache Iceberg tables |
Source Reference
| Component | File |
|---|---|
| Data source CRUD | DataSourceController.java |
| Data source entity | CatalogDataSource.java |
| Data source repository | CatalogDataSourceRepository.java |
| Catalog service | CatalogService.java |