Database connections
DataMaker can push generated rows directly into a database, no INSERT script in the
middle. We support six engines today.
| Engine | Driver / protocol | Notes |
|---|---|---|
| PostgreSQL | libpq, TLS | 12 — 17. RDS / Aurora / Supabase / Neon work. |
| MySQL | mysql-connector, TLS | 8.x. PlanetScale, Aurora MySQL work. |
| MongoDB | MongoDB wire protocol, TLS | 4.4+. Atlas works (use the SRV URL). |
| MSSQL | TDS, TLS | 2017+. Azure SQL works. |
| Oracle | OCI thin / thick | 19c+. Wallet auth supported. |
| IBM DB2 | DRDA | LUW 11.5+. z/OS via DRDA. |
Create a database connection
Project → Connections → New → Database, then pick the engine. Required fields:
- Name — what you’ll see in the UI and in API responses.
- Host and port.
- Database name (or schema for some engines).
- Username + password, or a managed secret reference.
Optional:
- TLS — force TLS, accept self-signed, attach a CA.
- SSH tunnel — for engines that aren’t public-internet-reachable.
- Schema (Postgres / Oracle / DB2) — default schema for unqualified table names.
Click Verify. We open a TCP connection, authenticate, and run SELECT 1 (or the
equivalent for MongoDB). Verified connections show a green dot in the sidebar.
Push a template
-
Open a template, click Generate → Push to….
-
Pick the connection. We discover the available tables / collections.
-
Pick a target table. The mapping screen suggests column matches by name; override any that are wrong.
-
Pick a mode:
insert— straightINSERT(or document insert).upsert—INSERT ... ON CONFLICT (key) DO UPDATE(Postgres / MySQL),MERGE(MSSQL / Oracle),replace(MongoDB).truncate-then-insert— replace all rows. Use with care.
-
Generate. Per-row success/failure is reported in the run log.
Push from a scenario
The same target is reachable from a Python scenario via the SDK:
from datamaker import DataMaker
dm = DataMaker() # picks up DM_API_KEYcustomers = dm.generate(template_id="tmpl_customer", count=500)
dm.connection("conn_postgres_dev").insert( table="customers", rows=customers, on_conflict="update", key="id",)For more, see Scenarios → Scenario API and API & SDKs → Python SDK.
Performance & batching
DataMaker batches inserts (default: 500 rows per batch). For very large pushes (>100k rows), prefer:
- Postgres:
COPYmode. Roughly 5× faster than batchedINSERT. - MongoDB:
bulk_write(default). - MSSQL:
BULK INSERTwith a temporary table swap.
Set the mode in the push dialog or via mode="copy" / mode="bulk" in the SDK.
Rolling back a push
DataMaker tracks every push as a run, with the IDs of inserted rows. From the run detail page you can rollback — DataMaker deletes the rows it inserted (matching by the key you pushed under). Rollback is best-effort; if downstream triggers / cascades have modified the rows, the delete may need a manual override.
Auth providers
For managed cloud databases, prefer IAM-style auth where possible:
- AWS RDS / Aurora: IAM authentication tokens.
- Azure SQL / Postgres: Microsoft Entra ID (formerly AAD).
- Google Cloud SQL: IAM database authentication.
In the connection form, pick Auth → Cloud IAM and follow the engine-specific setup guide.
See also
- Workflows → Seed CI/CD pipelines — best practices for ephemeral per-PR seeds.
- Troubleshooting → Common errors for connection failures (TLS, network, auth).