Skip to content

Commit fa14d0d

Browse files
authored
Merge remote-tracking branch 'origin/pr-217-head' into copilot/fix-comments-review-thread-217
2 parents f01dc6d + 894a551 commit fa14d0d

5 files changed

Lines changed: 379 additions & 0 deletions

File tree

.github/config/en-drasi.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ SignalRHub
210210
slidingWindow
211211
sortBy
212212
SourceConfirm
213+
startPosition
213214
sourceprovider
214215
SourceProvider
215216
SourceProviders

docs/content/drasi-server/how-to-guides/configuration/configure-bootstrap-providers/_index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ description: "Load initial data before streaming begins"
3232
</div>
3333
</div>
3434
</a> -->
35+
<a href="configure-mysql-bootstrap-provider/">
36+
<div class="unified-card unified-card--howto">
37+
<div class="unified-card-icon"><i class="fas fa-database"></i></div>
38+
<div class="unified-card-content">
39+
<h3 class="unified-card-title">MySQL</h3>
40+
<p class="unified-card-summary">Bootstrap from a MySQL snapshot (MySQL sources only)</p>
41+
</div>
42+
</div>
43+
</a>
3544
<a href="configure-postgres-bootstrap-provider/">
3645
<div class="unified-card unified-card--howto">
3746
<div class="unified-card-icon"><i class="fas fa-database"></i></div>
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
type: "docs"
3+
title: "Configure MySQL Bootstrap Provider"
4+
linkTitle: "MySQL"
5+
weight: 45
6+
description: "Bootstrap queries from a MySQL snapshot"
7+
related:
8+
howto:
9+
- title: "Configure Sources"
10+
url: "/drasi-server/how-to-guides/configuration/configure-sources/"
11+
- title: "Configure MySQL Source"
12+
url: "/drasi-server/how-to-guides/configuration/configure-sources/configure-mysql-source/"
13+
- title: "Configure Bootstrap Providers"
14+
url: "/drasi-server/how-to-guides/configuration/configure-bootstrap-providers/"
15+
---
16+
17+
The **MySQL bootstrap provider** loads initial state from a MySQL database so queries start with a complete snapshot before streaming begins.
18+
19+
## When to use MySQL bootstrap
20+
21+
- You need historical/current state from MySQL when a query starts.
22+
- Your query depends on existing rows (aggregations, joins, thresholds).
23+
- You want snapshot + binlog streaming from the same database.
24+
25+
## Prerequisites
26+
27+
- Use with a **MySQL source** (`sources[].kind: mysql`).
28+
- The database user must have **SELECT** permission on the configured tables.
29+
- The `tables` list is **required** — you must explicitly specify which tables to bootstrap.
30+
31+
## Quick example (Drasi Server config)
32+
33+
In Drasi Server config, bootstrap provider keys are **camelCase**, and the discriminator field is `bootstrapProvider.kind`.
34+
35+
```yaml
36+
sources:
37+
- kind: mysql
38+
id: orders-db
39+
autoStart: true
40+
41+
host: ${MYSQL_HOST:-localhost}
42+
port: ${MYSQL_PORT:-3306}
43+
database: ${MYSQL_DATABASE:-mydb}
44+
user: ${MYSQL_USER:-drasi_user}
45+
password: ${MYSQL_PASSWORD}
46+
47+
tables:
48+
- orders
49+
- customers
50+
51+
bootstrapProvider:
52+
kind: mysql
53+
```
54+
55+
## Configuration reference
56+
57+
| Field | Type | Required | Description |
58+
|---|---|---:|---|
59+
| `kind` | string | Yes | Must be `mysql`. |
60+
| `host` | string | No | MySQL host (default: `localhost`). |
61+
| `port` | integer | No | MySQL port (default: `3306`). |
62+
| `database` | string | Yes | Database name to connect to. |
63+
| `user` | string | Yes | Database user with SELECT permission. |
64+
| `password` | string | No | Password (default: `""`). |
65+
| `tables` | string[] | Yes | Table allow-list for bootstrapping. Must contain at least one table. |
66+
| `tableKeys` | array | No | Override key columns per table (see below). |
67+
68+
### tableKeys
69+
70+
Use `tableKeys` to define key columns for element ID generation when primary keys are missing.
71+
72+
```yaml
73+
bootstrapProvider:
74+
kind: mysql
75+
tableKeys:
76+
- table: order_items
77+
keyColumns: [order_id, product_id]
78+
```
79+
80+
## Notes
81+
82+
- Drasi Server only allows `kind: mysql` when the source is also `kind: mysql`.
83+
- The `tables` list acts as a security allow-list — only tables explicitly listed will be bootstrapped.
84+
- Table names must use only letters, numbers, and underscores.
85+
86+
## Documentation resources
87+
88+
<div class="card-grid card-grid--2">
89+
<a href="https://github.com/drasi-project/drasi-core/blob/main/components/bootstrappers/mysql/README.md" target="_blank" rel="noopener">
90+
<div class="unified-card unified-card--tutorials">
91+
<div class="unified-card-icon"><i class="fab fa-github"></i></div>
92+
<div class="unified-card-content">
93+
<h3 class="unified-card-title">MySQL Bootstrap README</h3>
94+
<p class="unified-card-summary">Implementation notes and behavior details</p>
95+
</div>
96+
</div>
97+
</a>
98+
<a href="https://crates.io/crates/drasi-bootstrap-mysql" target="_blank" rel="noopener">
99+
<div class="unified-card unified-card--howto">
100+
<div class="unified-card-icon"><i class="fas fa-box"></i></div>
101+
<div class="unified-card-content">
102+
<h3 class="unified-card-title">drasi-bootstrap-mysql on crates.io</h3>
103+
<p class="unified-card-summary">Package info and release history</p>
104+
</div>
105+
</div>
106+
</a>
107+
</div>

docs/content/drasi-server/how-to-guides/configuration/configure-sources/_index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ description: "Connect Drasi Server to databases, APIs, and data streams"
4848
</div>
4949
</div>
5050
</a> -->
51+
<a href="configure-mysql-source/">
52+
<div class="unified-card unified-card--howto">
53+
<div class="unified-card-icon"><i class="fas fa-database"></i></div>
54+
<div class="unified-card-content">
55+
<h3 class="unified-card-title">MySQL</h3>
56+
<p class="unified-card-summary">Stream changes from MySQL using binlog replication</p>
57+
</div>
58+
</div>
59+
</a>
5160
<a href="configure-postgresql-source/">
5261
<div class="unified-card unified-card--howto">
5362
<div class="unified-card-icon"><i class="fas fa-database"></i></div>

0 commit comments

Comments
 (0)