Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The **MySQL bootstrap provider** loads initial state from a MySQL database so qu

- Use with a **MySQL source** (`sources[].kind: mysql`).
- The database user must have **SELECT** permission on the configured tables.
- The `tables` list is **required** — you must explicitly specify which tables to bootstrap.
- Configure `tables` (and optional `tableKeys`) on the MySQL source.

## Quick example (Drasi Server config)

Expand Down Expand Up @@ -54,32 +54,16 @@ sources:

## Configuration reference

`mysql` accepts **no additional fields**.

| Field | Type | Required | Description |
|---|---|---:|---|
| `kind` | string | Yes | Must be `mysql`. |
| `host` | string | No | MySQL host (default: `localhost`). |
| `port` | integer | No | MySQL port (default: `3306`). |
| `database` | string | Yes | Database name to connect to. |
| `user` | string | Yes | Database user with SELECT permission. |
| `password` | string | No | Password (default: `""`). |
| `tables` | string[] | Yes | Table allow-list for bootstrapping. Must contain at least one table. |
| `tableKeys` | array | No | Override key columns per table (see below). |

### tableKeys

Use `tableKeys` to define key columns for element ID generation when primary keys are missing.

```yaml
bootstrapProvider:
kind: mysql
tableKeys:
- table: order_items
keyColumns: [order_id, product_id]
```

## Notes

- Drasi Server only allows `kind: mysql` when the source is also `kind: mysql`.
- Connection and table scope come from the MySQL source configuration (for example `host`, `database`, `tables`, and `tableKeys`).
- The `tables` list acts as a security allow-list — only tables explicitly listed will be bootstrapped.
- Table names must use only letters, numbers, and underscores.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The MySQL {{< term "Source" >}} streams row-level changes from a MySQL database

## Prerequisites

- MySQL **5.7+** or **8.0+**.
- MySQL **8.0+**.
- Binary logging enabled with row-based format:
- `binlog_format = ROW`
- `binlog_row_image = FULL`
Expand Down Expand Up @@ -129,7 +129,7 @@ If no key columns can be resolved for a row, the source logs a warning and falls
| `serverId` | integer | auto-generated | MySQL server ID for the replication connection. Auto-generated from source instance ID if not specified. |
| `heartbeatIntervalSeconds` | integer | `30` | Heartbeat interval in seconds for the replication connection. |

Fields marked with support Drasi Server config references like `${ENV_VAR}` / `${ENV_VAR:-default}`.
Fields support Drasi Server config references like `${ENV_VAR}` / `${ENV_VAR:-default}`.

### tableKeys

Expand Down Expand Up @@ -198,8 +198,7 @@ curl http://localhost:8080/api/v1/queries/my-query/results
### 4. Check binlog status in MySQL

```sql
SHOW BINARY LOG STATUS;
SHOW REPLICAS;
SHOW MASTER STATUS;
```

## Troubleshooting
Expand Down