Skip to content

Commit 18ce590

Browse files
fix: update template docs (#89)
1 parent 1675175 commit 18ce590

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

docs/changes/introduction.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ Use YAML or JSON definitions with reusable templates. Perfect for repetitive ope
6161
# File: _0002__AddStatusColumn.yaml
6262
id: add_status_column
6363
author: "db-team"
64-
templateName: sql-template
64+
template: SqlTemplate
65+
targetSystem: "sql-target-system"
6566
apply: "ALTER TABLE orders ADD COLUMN status VARCHAR(20);"
6667
rollback: "ALTER TABLE orders DROP COLUMN status;"
6768
```

docs/changes/types-and-implementation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ id: add_user_index
3030
author: "database-team"
3131
description: "Add index on user email field for faster lookups"
3232
targetSystem: "user-database"
33-
templateName: mongodb-index
33+
template: mongodb-index
3434
apply:
3535
type: createIndex
3636
collection: users

docs/get-started/Change-as-Code.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ public class _0005__UpdateBucketSettingsChange {
201201
id: "ProvisionBucket"
202202
author: "team-a"
203203
transactional: false
204-
templateName: aws-s3-template
204+
template: aws-s3-template
205+
targetSystem: "s3"
205206
apply:
206207
bucketName: "flamingock-app-bucket"
207208
region: "us-east-1"
@@ -214,7 +215,8 @@ rollback:
214215
id: "CreateKafkaTopics"
215216
author: "devops"
216217
transactional: false
217-
templateName: kafka-template
218+
template: kafka-template
219+
targetSystem: "kafka"
218220
apply:
219221
topics:
220222
- "app-events"
@@ -264,7 +266,8 @@ rollback:
264266
id: "SeedDatabase"
265267
author: "devops"
266268
transactional: true
267-
templateName: sql-template
269+
template: SqlTemplate
270+
targetSystem: "sql-target-system"
268271
apply: |
269272
INSERT INTO tenants (id, name, created_at)
270273
VALUES (1, 'TenantA', NOW()), (2, 'TenantB', NOW());
@@ -277,7 +280,8 @@ rollback: |
277280
id: "UpdateBucketSettings"
278281
author: "team-a"
279282
transactional: false
280-
templateName: aws-s3-template
283+
template: aws-s3-template
284+
targetSystem: "s3"
281285
apply:
282286
# Enable versioning on an existing bucket
283287
bucketName: "flamingock-app-bucket"

docs/get-started/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Changes can be:
119119
id: add-product-category
120120
author: team
121121
targetSystem: mysql-inventory
122-
template: sql-template
122+
template: SqlTemplate
123123
apply: |
124124
ALTER TABLE products ADD COLUMN category VARCHAR(255)
125125
rollback: |

docs/templates/templates-how-to-use.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@ This feature is a **sneak peek of Flamingock's future**: a low-code, reusable ec
1919

2020
Using a Flamingock Template is straightforward. Here's an example of how you can apply an SQL-based change using the **SQL Template**.
2121

22-
:::note
22+
:::danger
2323
This example uses the **SQL Template**, which is experimental. It is intended for testing and feedback, not yet production use.
2424
:::
2525

2626
### Step 1: Add the Template dependency
2727

28-
Ensure your **Flamingock Template** dependency is included in your project. Example of using `sql-template`:
28+
Ensure your **Flamingock Template** dependency is included in your project. Example of using `SqlTemplate`:
2929

3030
<Tabs groupId="gradle_maven">
3131
<TabItem value="gradle" label="Gradle">
3232
```kotlin
3333
implementation(platform("io.flamingock:flamingock-community-bom:$flamingockVersion"))
34-
implementation("io.flamingock:flamingock-community-sql-template")
34+
implementation("io.flamingock:flamingock-sql-template")
3535
```
3636
</TabItem>
3737
<TabItem value="maven" label="Maven">
3838
```xml
3939
<dependency>
4040
<groupId>io.flamingock</groupId>
41-
<artifactId>flamingock-community-sql-template</artifactId>
41+
<artifactId>flamingock-sql-template</artifactId>
4242
</dependency>
4343
```
4444
</TabItem>
@@ -55,7 +55,7 @@ Create a **YAML file** (e.g., `_0001__CreatePersonsTable.yaml`) inside your appl
5555
```yaml
5656
id: CreatePersonsTableFromTemplate
5757
targetSystem: "database-system"
58-
templateName: sql-template
58+
template: SqlTemplate
5959
recovery:
6060
strategy: ALWAYS_RETRY # Safe to retry - CREATE TABLE IF NOT EXISTS semantics
6161
apply: |
@@ -74,7 +74,7 @@ rollback: "DROP TABLE IF EXISTS Persons;"
7474
- **`id`**: Unique identifier for the change, used for tracking (same as in code-based changes).
7575
- **`order`**: Execution order relative to other changes (also shared with code-based).
7676
- **`targetSystem`**: Specifies which target system this change applies to - **required** for all template-based changes, just like code-based Changes.
77-
- **`templateName`**: Indicates which template should be used to handle the change logic. This is **required** for all template-based changes.
77+
- **`template`**: Indicates which template should be used to handle the change logic. This is **required** for all template-based changes.
7878
- **`apply`**: Direct apply logic for the change. The format depends on the template type (string for SQL, map for MongoDB, etc.).
7979
- **`rollback`**: Direct rollback logic for the change. The format depends on the template type (string for SQL, map for MongoDB, etc.).
8080
- **`recovery`**: Optional failure handling configuration. Contains:
@@ -96,7 +96,7 @@ To configure Flamingock to use the YAML template file, you need to define a stag
9696
```java
9797
@EnableFlamingock(
9898
stages = {
99-
@Stage(location = "src/main/resources/templates")
99+
@Stage(location = "resources/templates")
100100
}
101101
)
102102
public class MainApplication {
@@ -152,8 +152,8 @@ With the **SQL Template**, users define the same change in **YAML** instead of J
152152

153153
```yaml
154154
id: createPersonsTableFromTemplate
155-
stargetSystem: "database-system"
156-
templateName: sql-template
155+
targetSystem: "database-system"
156+
template: SqlTemplate
157157
recovery:
158158
strategy: MANUAL_INTERVENTION # Critical DDL operation - requires manual review on failure
159159
apply: |

0 commit comments

Comments
 (0)