You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(databases-on-aws): correct DSQL type guidance, add cluster-lifecycle troubleshooting (#155)
* fix(databases-on-aws): correct DSQL type guidance, add cluster-lifecycle troubleshooting
Update DSQL skill to reflect current DSQL type support: JSON is a supported
column type (1 MiB, auto-compressed), while JSONB, arrays, and INET remain
runtime-only. Replace the narrow quick-reference type list with a pointer to
the canonical AWS docs and an awsknowledge verify-query row, so the skill
does not drift as DSQL's type surface evolves.
Add troubleshooting entries for the INACTIVE-cluster wake error and the
FailedPrecondition returned when backing up an IDLE/INACTIVE cluster, with a
pointer to the cluster-lifecycle documentation.
Extend the Tier 2 functional eval suite with four new evals covering the
updated behaviors — JSON column storage, array-column rejection, the
INACTIVE-cluster wake flow, and FailedPrecondition backup-on-idle — plus
grader clauses they need and an --eval-ids flag on the runner for targeted
subset runs.
Verified against live cluster: JSON accepted as column type; JSONB and TEXT[]
rejected with "datatype not supported"; ::jsonb cast + ->> / @> operators
work as expected. node-postgres auto-serializes JS objects for both JSON and
TEXT columns.
All four new evals pass 11/11 expectations when run against the updated skill.
Co-Authored-By: anwesham-lab <64298192+anwesham-lab@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(databases-on-aws): bump version to 1.1.0
Ships the DSQL skill updates from this branch: corrected type guidance
(JSON supported, JSONB/arrays/INET runtime-only), cluster-lifecycle
troubleshooting (INACTIVE wake, FailedPrecondition on IDLE/INACTIVE
backup), and the expanded Tier 2 eval suite (evals 6-9) with LLM-judge
grading and the --eval-ids/--judge-model runner flags.
Co-Authored-By: anwesham-lab <64298192+anwesham-lab@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: plugins/databases-on-aws/.codex-plugin/plugin.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "databases-on-aws",
3
-
"version": "1.0.0",
3
+
"version": "1.1.0",
4
4
"description": "Expert database guidance for the AWS database portfolio. Design schemas, execute queries, handle migrations, and choose the right database for your workload.",
| Supported column data types | See docs |`aurora dsql supported data types`|
156
157
157
-
**When to verify:** Before recommending batch sizes, connection pool settings, or schema designs
158
-
where hitting a limit would cause failures. No need to verify for general guidance or when
159
-
the exact number doesn't affect the user's decision.
158
+
**When to verify:** Before recommending batch sizes, connection pool settings, or schema designs where hitting a limit would cause failures; any time the exact number can affect user decision.
160
159
161
-
**Fallback:** If `awsknowledge` is unavailable, use the defaults above and note to the user
162
-
that limits should be verified against [DSQL documentation](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/).
160
+
**Fallback:** If `awsknowledge` is unavailable, use the defaults above and flag that limits should be verified against [DSQL documentation](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/).
163
161
164
162
## CLI Scripts Available
165
163
@@ -208,7 +206,7 @@ ALTER COLUMN TYPE, DROP COLUMN, DROP CONSTRAINT → Table Recreation Pattern (Wo
208
206
- MUST include tenant_id in all tables
209
207
- MUST use `CREATE INDEX ASYNC` exclusively
210
208
- MUST issue each DDL in its own transact call: `transact(["CREATE TABLE ..."])`
211
-
- MUST store arrays/JSON as TEXT
209
+
- MUST serialize arrays as TEXT or JSON; cast back at query time (`string_to_array(text, ',')` or `jsonb_array_elements_text(json::jsonb)`)
Copy file name to clipboardExpand all lines: plugins/databases-on-aws/skills/dsql/references/development-guide.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,8 @@ effortless scaling, multi-region viability, among other advantages.
13
13
-**REQUIRED: Follow DDL Guidelines** - Refer to [DDL Rules](#schema-ddl-rules)
14
14
-**SHALL repeatedly generate fresh tokens** - Refer to [Connection Limits](auth/authentication-guide.md#connection-rules)
15
15
-**ALWAYS use ASYNC indexes** - `CREATE INDEX ASYNC` is mandatory
16
-
-**MUST Serialize arrays/JSON as TEXT** - Store arrays/JSON as TEXT (comma separated, JSON.stringify)
16
+
-**MUST serialize arrays as TEXT or JSON** - see [Schema Design Rules](#schema-design-rules)
17
+
-**MUST cast to `JSONB` at query time** for JSONB operators — see [Supported Data Types](#supported-data-types)
17
18
-**ALWAYS Batch within row limit** - maintain transaction limits (verify via `awsknowledge`: `aurora dsql transaction limits`)
18
19
-**REQUIRED: Build and sanitize all SQL with `safe_query.build()`** - See [Input Validation](../mcp/tools/input-validation.md#required-pattern)
19
20
-**MUST follow correct Application Layer Patterns** - when multi-tenant isolation or application referential integrity are required; refer to [Application Layer Patterns](#application-layer-patterns)
@@ -53,9 +54,8 @@ effortless scaling, multi-region viability, among other advantages.
53
54
54
55
### Schema Design Rules
55
56
56
-
- MUST use **simple PostgreSQL types:** VARCHAR, TEXT, INTEGER, BOOLEAN, TIMESTAMP
57
-
- MUST store arrays as TEXT (comma-separated is recommended)
58
-
- MUST store JSON objects as TEXT (JSON.stringify)
57
+
- MUST verify column types via `awsknowledge`: `aurora dsql supported data types` or the [DSQL supported data types list](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/working-with-postgresql-compatibility-supported-data-types.html)
58
+
- MUST serialize arrays as TEXT or JSON; cast back at query time via `string_to_array(text, ',')` or `jsonb_array_elements_text(json::jsonb)`
59
59
- ALWAYS include tenant_id in tables for multi-tenant isolation
60
60
- SHOULD create async indexes for tenant_id and common query patterns
61
61
@@ -124,9 +124,9 @@ UPDATE table SET c = 'default' WHERE c IS NULL; ← AFTER ADD COLUMN
**MUST verify** column types against the [DSQL supported data types docs](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/working-with-postgresql-compatibility-supported-data-types.html) or via `awsknowledge`: `aurora dsql supported data types` — the supported set evolves, so do not treat any static list as exhaustive.
128
+
129
+
`JSONB`, arrays, and `INET` are **[runtime-only](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/working-with-postgresql-compatibility-supported-data-types.html#working-with-postgresql-compatibility-query-runtime)** — cast at query time
Copy file name to clipboardExpand all lines: plugins/databases-on-aws/skills/dsql/references/examples/patterns.md
+13-21Lines changed: 13 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,9 +129,12 @@ INSERT INTO distributors VALUES (nextval('order_seq'), 'nothing');
129
129
130
130
---
131
131
132
-
## Data Serialization
132
+
## Runtime-Only Types
133
133
134
-
**Pattern:** MUST store arrays and JSON as TEXT (runtime-only types). Per [DSQL docs](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/working-with-postgresql-compatibility-supported-data-types.html), cast to JSON at query time.
134
+
`JSONB`, arrays, and `INET` are [runtime-only](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/working-with-postgresql-compatibility-supported-data-types.html#working-with-postgresql-compatibility-query-runtime) — not valid as column types.
135
+
136
+
-**MUST** serialize arrays as `TEXT` or `JSON` — use `TEXT` (comma-separated) for homogeneous short strings; use `JSON` when elements may contain commas or aren't homogeneous
137
+
-**MUST** cast back at query time — `string_to_array(text, ',')` for TEXT, `jsonb_array_elements_text(json::jsonb)` for JSON
135
138
136
139
```javascript
137
140
functiontoTextArray(values) {
@@ -142,32 +145,21 @@ function fromTextArray(textValue) {
@@ -70,7 +70,7 @@ transact(["CREATE INDEX ASYNC idx_products_category ON products(tenant_id, categ
70
70
|`MEDIUMTEXT`|`TEXT`|
71
71
|`ENUM(...)`|`VARCHAR(255)` with `CHECK` constraint |
72
72
|`SET(...)`|`TEXT` (comma-separated) |
73
-
|`JSON`|`TEXT` (JSON.stringify)|
73
+
|`JSON`|`JSON`|
74
74
|`UNSIGNED`|`CHECK (col >= 0)`|
75
75
|`TINYINT(1)`|`BOOLEAN`|
76
76
|`DATETIME`|`TIMESTAMP`|
@@ -99,7 +99,6 @@ transact(["CREATE INDEX ASYNC idx_products_category ON products(tenant_id, categ
99
99
-**MUST convert** AUTO_INCREMENT to UUID with gen_random_uuid(), IDENTITY column with `GENERATED AS IDENTITY (CACHE ...)`, or explicit SEQUENCE -- ALWAYS use `GENERATED AS IDENTITY` for auto-incrementing columns (see [AUTO_INCREMENT Migration](ddl-auto-increment.md#auto_increment-migration))
100
100
-**MUST replace** ENUM with VARCHAR and CHECK constraint
101
101
-**MUST replace** SET with TEXT (comma-separated)
102
-
-**MUST replace** JSON columns with TEXT
103
102
-**MUST replace** FOREIGN KEY constraints with application-layer referential integrity
104
103
-**MUST replace** ON UPDATE CURRENT_TIMESTAMP with application-layer updates
105
104
-**MUST convert** all index creation to use CREATE INDEX ASYNC
| AUTO_INCREMENT | UUID with gen_random_uuid(), IDENTITY column, or SEQUENCE | See [AUTO_INCREMENT Migration](ddl-auto-increment.md#auto_increment-migration) for all three options |
Copy file name to clipboardExpand all lines: plugins/databases-on-aws/skills/dsql/references/onboarding.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ These guidelines apply when users say "Get started with DSQL" or similar phrases
35
35
- Example:
36
36
- "What column names would you like in this table?"
37
37
- "What is the column name of the primary key?"
38
-
- "JSON must be serialized. Would you like to stringify the JSON to serialize it as TEXT?"
38
+
- "Would you like to store this in a `JSON` column, or serialize as TEXT?"
39
39
40
40
**Examples:**
41
41
@@ -252,7 +252,9 @@ cargo add aws-sdk-dsql tokio --features full
252
252
- If yes, MUST verify DSQL compatibility:
253
253
- No SERIAL types (use `GENERATED AS IDENTITY` with sequences, or UUID)
254
254
- No foreign keys (implement in application)
255
-
- No array/JSON column types (serialize as TEXT)
255
+
- Serialize arrays as TEXT or JSON; cast back at query time (`string_to_array(text, ',')` / `jsonb_array_elements_text(json::jsonb)`)
256
+
- Cast to `JSONB` at query time for JSONB operators (`JSONB` is not a valid column type)
257
+
- Verify column types against the [supported data types list](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/working-with-postgresql-compatibility-supported-data-types.html)
256
258
- Reference [`./development-guide.md`](./development-guide.md) for full constraints
257
259
258
260
**If no schema found:**
@@ -349,7 +351,7 @@ Let them know you're ready to help with more:
349
351
**ALWAYS follow these rules:**
350
352
351
353
1.**Indexes:** Use `CREATE INDEX ASYNC` - synchronous index creation not supported
352
-
2.**Serialization:**Store arrays/JSON as TEXT (comma-separated or JSON.stringify)
354
+
2.**Runtime-only types:**Serialize arrays as TEXT or JSON; cast to `JSONB` at query time for JSONB operators
353
355
3.**Referential Integrity:** Implement foreign key validation in application code
354
356
4.**DDL Operations:** Execute one DDL per transaction, no mixing with DML
355
357
5.**Transaction Limits:** Maximum 3,000 row modifications, 10 MiB data size per transaction
0 commit comments