D DbFace Docs Product documentation and guides
Data

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
mysqlMySQL relational databaseBusiness systems and operational databases
postgresqlPostgreSQL databaseAnalytics stores and platform databases
sqliteSQLite file databaseLocal demos and small deployments
clickhouseClickHouse analytics databaseHigh-performance aggregation queries
apiREST API datasourceExternal services and business APIs
fileFile-based datasourceImport 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.

Only admins should receive full connection configuration details in management views. Sensitive connection information should not be exposed to lower-privilege roles.

Management flow

  1. Create a datasource and fill in the connection configuration.
  2. Test the connection in the datasource list view.
  3. Optionally set it as the default datasource for the organization.
  4. 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.