Element <database>¶
Purpose: Declare a named relational database client for reads, writes, and SQL execution.
Why: Use it to give relational reads, writes, selectors, and SQL execution one client id.
Example¶
1 | |
Decision guide¶
Business value: Centralizes relational connectivity for selectors, SQL setup, inserts, and database operations.
-
Use when
- A descriptor reads from or writes to a relational database.
-
Choose another approach when
- The source is a MongoDB collection, file, object store, or message broker.
-
Prerequisites
- Choose the DBMS and provide its required connection properties through project configuration.
-
Alternatives
- Use mongodb for collection-oriented document data. (See:
<mongodb>)
- Use mongodb for collection-oriented document data. (See:
Complete examples¶
Prepare and read a deterministic relational source
Use a named database client when SQL preparation, source selection, and later targets must share one connection contract.
| sqlite-assembly/datamimic.xml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Rules and invalid combinations¶
A relational client requires a database locator.
Attributes: dbms, database
Why: The DBMS and network endpoint do not identify the database, service, or catalog to open.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
Allowed parents / Allowed children¶
Allowed parents: else, else-if, if, setup, while
Allowed children:
None
Extension attributes: The declared attributes are complete. This element also accepts runtime-defined vendor extensions, which intentionally have no static completion.
Related concepts and use cases¶
- Generate Database-backed Sequences — Explains bounded database sequence reservation and its single-process policy.
- Choose a source and target — Guides users and agents from an input ownership boundary and intended side effect to one bounded source and target contract.
Attributes¶
Show all 10 attributes
database
Database name (schema/catalog/service) used to connect.
optional; string; Default: null.
dbms
DBMS type (e.g., postgresql, mysql).
optional; string; Values: sqlite, postgresql, postgres, mysql, mssql, sqlserver, oracle.
environment
Optional environment label for this database.
optional; string; Default: null.
host
Hostname or IP of the database server.
optional; string; Default: null.
id
Database ID for accessing the database in the script context.
required; string.
password
Password for the database connection.
optional; string; Default: null.
port
Port number of the database server.
optional; string; Default: null.
schema
Default schema when connecting (optional).
optional; string; Default: null.
system
Optional platform system identifier used to resolve environment properties.
optional; string; Default: null.
user
Username for the database connection.
optional; string; Default: null.