Skip to content

Data source - *.datasource

Registers a named JDBC pool with the platform. Synchronizer: DataSourcesSynchronizer (components/data/data-sources). Engine: HikariCP-backed DataSourcesManager.

File format

json
{
    "name": "ReportsDB",
    "driver": "org.postgresql.Driver",
    "url": "jdbc:postgresql://db:5432/reports",
    "username": "${env.REPORTS_USER}",
    "password": "${env.REPORTS_PASSWORD}",
    "properties": {
        "ApplicationName": "dirigible",
        "tcpKeepAlive": "true"
    }
}

Drop the file anywhere under /registry/public/<project>/... and publish. The pool appears in the Database perspective and is reachable by name from user code:

ts
import { Database } from "@aerokit/sdk/db";
const conn = Database.getConnection("ReportsDB");
java
java.sql.Connection conn = org.eclipse.dirigible.sdk.db.Database.getConnection("ReportsDB");

Fields

FieldRequiredNotes
nameyesLogical handle used by Database.getConnection(name). Must be unique per tenant.
driveryesFully-qualified JDBC driver class.
urlyesJDBC URL. Supports ${env.*} interpolation.
usernamenoPool credential. Supports ${env.*}.
passwordnoPool credential. Supports ${env.*}.
propertiesnoMap merged into the driver's connection properties.

Default data source

The platform's default JDBC pool is not declared as a *.datasource - it is configured via DIRIGIBLE_DATASOURCE_DEFAULT_DRIVER / _URL / _USERNAME / _PASSWORD. See /help/setup/databases/.

Tenant isolation

When multi-tenancy is on (default), each tenant gets its own resolved pool. The SystemDB is system-level.

Editor

Edit visually in the Database perspective or as JSON in Monaco.

See also

Released under the EPL-2.0 License.