Datasources
Datasources are the entry layer for DbFace. Report execution, SQL preview, schema browsing, Cloud Code queries, and file import all depend on datasource capabilities.
Supported datasource types
| Type | Description | Typical use |
|---|---|---|
| mysql | MySQL relational database | Business systems and operational databases |
| postgresql | PostgreSQL database | Analytics stores and platform databases |
| sqlite | SQLite file database | Local demos and small deployments |
| clickhouse | ClickHouse analytics database | High-performance aggregation queries |
| api | REST API datasource | External services and business APIs |
| file | File-based datasource | Import CSV or spreadsheet data into queryable tables |
Connection security
Datasource connection information is stored in datasources.connection_config and encrypted with Fernet
at the model layer. That means connection details are not stored as plain text in the database.
Management flow
- Create a datasource and fill in the connection configuration.
- Test the connection in the datasource list view.
- Optionally set it as the default datasource for the organization.
- Validate structure and fields in the schema browser or SQL Workshop.
Default datasource
DbFace supports an organization-level default datasource. When a new report is created without an explicit datasource, the editor can fall back to this default.
Schema and data browsing
Datasources do more than power SQL execution. They also support the editing experience:
- List available tables and columns.
- Insert table names and fields from the editor sidebar.
- Browse table data with pagination, search, and sorting.
API datasources
API datasources use a dedicated executor path. They are useful when report data should come from HTTP services instead of a relational database.
Typical configuration includes URL, method, authentication, response path, timeout, and custom headers.
File datasources
File import turns uploaded content into a SQLite table and creates a matching datasource record. This lets business users browse and query imported files like a regular datasource.
Best practices
- Use dedicated read-only database accounts in production.
- Bind stable reports to stable datasources instead of pushing everything through API datasources.
- Validate structure in SQL Workshop before moving queries into DSDL.
- When Cloud Code uses a dedicated datasource, document its permission boundary explicitly.