Generated banner for Dsql
Generated logo for Dsql

Dsql

ClineOfficialPublished by Cline

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, FK replacement code generation, OCC retry patterns, ORM migration (Django/Hibernate/Rails), DDL operations, query plan explainability, SQL compatibility validation, and bulk data loading. Triggers on phrases like: DSQL, Aurora DSQL, distributed SQL database, serverless PostgreSQL-compatible database, migrate to DSQL, DSQL query plan, DSQL EXPLAIN ANALYZE, DSQL ENUM, DSQL foreign key, DSQL OCC retry, DSQL multi-region, DSQL JSONB, DSQL GIN index, load into DSQL, load CSV into DSQL, bulk load DSQL, aurora-dsql-loader.
— the description by Cline

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The dsql skill provides a structured framework for working with Amazon Aurora DSQL, a serverless, distributed SQL database. It covers the full lifecycle of database operations, including schema management, multi-tenant design, IAM-based authentication, and migration strategies from MySQL or PostgreSQL. The skill integrates with MCP tools to facilitate direct query execution, SQL linting, and documentation access, while enforcing best practices for transaction limits, OCC retry patterns, and bulk data loading.

What it does

  • Provides MCP tools for direct query execution, schema inspection, and SQL compatibility linting.
  • Offers step-by-step workflows for migrating existing MySQL and PostgreSQL databases to DSQL.
  • Guides users through implementing multi-tenant isolation and application-layer referential integrity.
  • Supplies patterns for handling OCC retries and batching DDL/DML operations within transaction limits.
  • Facilitates bulk data loading from CSV, TSV, or Parquet files using specialized loader utilities.
  • Includes diagnostic procedures for query plan explainability and performance optimization.

When to use it

  • When starting a new project or migrating an existing application to Aurora DSQL.
  • When performing schema migrations or complex DDL operations that require validation.
  • When troubleshooting performance issues or unexpected query plans.
  • When implementing secure, IAM-based access control and scoped database roles.
  • When bulk loading large datasets into a DSQL cluster.

Advantages

  • Ensures adherence to DSQL-specific constraints and best practices through linting and structured workflows.
  • Simplifies complex migrations with pre-defined type mapping and schema conversion patterns.
  • Promotes secure development by enforcing IAM authentication and least-privilege access control.
  • Reduces operational risk by providing clear procedures for transaction management and error recovery.
  • Standardizes diagnostic reporting for query performance analysis.

Usage examples

“How do I migrate my existing PostgreSQL schema to Aurora DSQL?”
The agent will guide you through using dsql_lint for compatibility checks, applying specific type mappings from the pg-migrations reference, and handling unfixable patterns manually.
“I am getting an OCC serialization error, how do I fix it?”
The agent will provide the standard OCC retry pattern and suggest checking for hot-key contention using the troubleshooting reference.
“How do I securely connect my application to DSQL using IAM?”
The agent will explain how to map IAM roles to scoped database roles and provide the command to generate a temporary DB connect token.
“Analyze this slow query plan for my DSQL cluster.”
The agent will initiate the query plan explainability workflow, requiring you to provide the plan while it guides you through diagnostic steps and produces a structured report.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/cline/dsql/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip dsql.zip -d .agents/skills

Documentation by Cline

Amazon Aurora DSQL Skill

Aurora DSQL is a serverless, PostgreSQL-compatible distributed SQL database. This skill covers direct query execution via MCP tools, schema management, migrations, multi-tenant isolation, IAM auth, and bulk data loading via aurora-dsql-loader.


Reference Files

Load these files as needed for detailed guidance:

Core:
ReferenceWhen to LoadContains
development-guide.mdALWAYS before schema changes or DB operationsBest practices, DDL rules, transaction limits, app-layer referential integrity
language.mdMUST load for language-specific choicesDriver selection, DSQL Connectors, connection code
access-control.mdMUST load for roles, grants, or sensitive dataScoped role setup, IAM-to-database role mapping
troubleshooting.mdSHOULD load for errors or unexpected behaviorOCC errors, connection failures, cluster state errors, token expiry, DDL rejection causes
dsql-examples.mdLoad for implementation examplesMulti-tenant schema examples, batch operations, FK validation patterns, connection pooling
onboarding.mdUser requests "Get started with DSQL"Interactive step-by-step guide
occ-retry-patterns.mdMUST load for OCC retry code or conflict mitigationDSQL Connectors, manual retry pattern, idempotent design
MCP:
ReferenceWhen to LoadContains
mcp-setup.mdAlways for MCP server guidanceSetup instructions, 2 configuration options
mcp-tools.mdFor MCP tool syntax and examplesTool parameters, input validation
dsql-lint.mdMUST load before running dsql_lint or processing external SQLTool reference, fix statuses, unfixable error resolution
DDL Migrations:
ReferenceWhen to LoadContains
ddl-migrations/overview.mdMUST load for DROP COLUMN, ALTER TYPE, DROP CONSTRAINTTable recreation pattern, verify & swap
ddl-migrations/column-operations.mdDROP COLUMN, ALTER TYPE, SET/DROP NOT NULL/DEFAULTColumn-level migration patterns
ddl-migrations/constraint-operations.mdADD/DROP CONSTRAINT, MODIFY PRIMARY KEYConstraint and structural changes
ddl-migrations/batched-migration.mdTables exceeding 3,000 rowsBatching patterns, progress tracking
MySQL Migrations:
ReferenceWhen to LoadContains
mysql-migrations/type-mapping.mdMUST load for MySQL → DSQL migrationData type mappings, feature alternatives
mysql-migrations/ddl-operations.mdTranslating MySQL DDL to DSQLAUTO_INCREMENT, ENUM, SET, FK patterns
mysql-migrations/full-example.mdComplete MySQL table migrationEnd-to-end example with decision summary
PostgreSQL Migrations:
ReferenceWhen to LoadContains
pg-migrations/type-mapping.mdMUST load for PG → DSQL type questionsC collation rules, NUMERIC precision, JSON/JSONB
pg-migrations/fk-replacement.mdMUST load for FK validation code generationTenant-scoped validate_fk_*() template, cascade
pg-migrations/index-conversion.mdMUST load for unfixable index diagnosticsGIN/GiST/BRIN → btree, partial, expression indexes
pg-migrations/schema-objects.mdMUST load for ENUM, materialized views, extensions, multi-schemaENUM → CHECK, views, role/IAM mapping
pg-migrations/multi-region.mdMulti-region, active-active, or HA questionsArchitecture, geographic partitioning
ORM Guides:
ReferenceWhen to LoadContains
orm-guides/overview.mdMigrating any ORM to DSQLAdapter names, key gotchas for Django/Hibernate/Rails/SQLAlchemy
Data Loading:
ReferenceWhen to LoadContains
data-loading.mdPlanning or running bulk loads with aurora-dsql-loaderFresh-vs-warm partitions, resume/retry, --on-conflict semantics, throughput diagnostics
Query Plan Explainability:
ReferenceWhen to LoadContains
query-plan/plan-interpretation.mdMUST load at Workflow 9 Phase 0DSQL node types, Node Duration math, estimation-error bands
query-plan/catalog-queries.mdMUST load at Workflow 9 Phase 0pg_class/pg_stats/pg_indexes SQL, correlated-predicate verification
query-plan/guc-experiments.mdMUST load at Workflow 9 Phase 0GUC experiment procedures, 30-second skip protocol
query-plan/report-format.mdMUST load at Workflow 9 Phase 0Required report structure, element checklist, support request template

MCP Tools Available

The aurora-dsql MCP server provides these tools:

Database Operations:

  1. readonly_query - Execute SELECT queries (returns list of dicts)

  2. transact - Execute DDL/DML statements in transaction (takes list of SQL statements)

  3. get_schema - Get table structure for a specific table

SQL Validation:

  1. dsql_lint - Validate SQL for DSQL compatibility and optionally auto-fix issues. Use before executing externally-sourced SQL.

Documentation & Knowledge:

  1. dsql_search_documentation - Search Aurora DSQL documentation

  2. dsql_read_documentation - Read specific documentation pages

  3. dsql_recommend - Get DSQL best practice recommendations

Note: There is no list_tables tool. Use readonly_query with information_schema.

See mcp-setup.md for detailed setup instructions. See mcp-tools.md for detailed usage and examples.

AWS Knowledge MCP (awsknowledge)

Consult for verifying DSQL service limits before advising users. The numeric limits below are defaults that may change — when a user's decision depends on an exact limit, verify it first:

LimitDefaultVerify query
Max rows per transaction3,000aurora dsql transaction limits
Max data size per transaction10 MiBaurora dsql transaction limits
Max transaction duration5 minutesaurora dsql transaction limits
Max connections per cluster10,000aurora dsql connection limits
Auth token expiry15 minutesaurora dsql authentication token
Max connection duration60 minutesaurora dsql connection limits
Max indexes per table24aurora dsql index limits
Max columns per index8aurora dsql index limits
IDENTITY/SEQUENCE CACHE values1 or >= 65536aurora dsql sequence cache
Supported column data typesSee docsaurora dsql supported data types

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.

Fallback: If awsknowledge is unavailable, use the defaults above and flag that limits should be verified against DSQL documentation.

CLI Tools

Use the AWS CLI, psql, and aurora-dsql-loader directly for cluster management, SQL connections, and bulk data loading from local or S3 CSV/TSV/Parquet files. Load data-loading.md for loader guidance.


Quick Start

  1. Explore: Use readonly_query with information_schema to list tables. Use get_schema for table structure.

  2. Query: Use readonly_query for SELECT queries. MUST include tenant_id in WHERE for multi-tenant apps. MUST build SQL with safe_query.build().

  3. Schema changes: Use transact with one DDL per transaction. MUST batch DML under 3,000 rows. MUST use CREATE INDEX ASYNC in a separate call. Use dsql_lint to validate first.

  4. Bulk load data: Use aurora-dsql-loader for CSV/TSV/Parquet. Load data-loading.md for details. Use --dry-run first.


Common Workflows

Workflow 1: Create Multi-Tenant Schema
  1. Create main table with tenant_id column using transact

  2. Create async index on tenant_id in separate transact call

  3. Create composite indexes for common query patterns (separate transact calls)

  4. Verify schema with get_schema

  • MUST include tenant_id in all tables

  • MUST use CREATE INDEX ASYNC exclusively

  • MUST issue each DDL in its own transact call: transact(["CREATE TABLE ..."])

  • MUST serialize arrays as JSONB; expand at query time with jsonb_array_elements_text(data)

Workflow 2: Safe Data Migration

MUST validate every DDL with dsql_lint(fix=true) before executing. DML does not require linting.

  1. Validate DDL with dsql_lint(sql=..., fix=true) — handle diagnostics per dsql-lint.md

  2. Add column: transact(["ALTER TABLE ... ADD COLUMN ..."])

  3. Populate existing rows with UPDATE (batched under 3,000 rows)

  4. Verify with readonly_query COUNT

  5. Create index if needed: validate then transact(["CREATE INDEX ASYNC ..."])

  • MUST issue each ALTER TABLE in its own transact call — DSQL rejects multi-DDL transactions with multiple ddl statements not supported in a transaction

  • MUST add column with only name and type; apply DEFAULT via separate UPDATE

  • MUST batch updates under 3,000 rows in separate transact calls

Recovery: Resume failed batches by filtering WHERE new_column IS NULL.

Workflow 3: Bulk Data Loading

Use aurora-dsql-loader for CSV, TSV, or Parquet loads. MUST load data-loading.md before advising on throughput or diagnosing slow loads.

  1. Validate with --dry-run first

  2. Run with --manifest-dir on persistent storage (not /tmp — tmpfs on AL2023, lost on crash) and --header if file has a header row

  3. On failure: resume with --resume-job-id; for duplicates use --on-conflict do-nothing

  4. For large tables: create secondary indexes after load using CREATE INDEX ASYNC

Workflow 4: Application-Layer Referential Integrity

INSERT: MUST validate parent exists with readonly_query → throw error if not found → insert child with transact.

DELETE: MUST check dependents with readonly_query COUNT → return error if dependents exist → delete with transact if safe.

Workflow 5: Query with Tenant Isolation
  1. MUST authorize the caller against the tenant — format validation does not establish authorization

  2. MUST build SQL with safe_query.build() — use allow()/regex() for values (emits 'v'), ident() for table/column names (emits "v"). See input-validation.md

  3. MUST include tenant_id in the WHERE clause; reject cross-tenant access at the application layer

Workflow 6: Set Up Scoped Database Roles

MUST load access-control.md for role setup, IAM mapping, and schema permissions.

Workflow 7: Table Recreation DDL Migration

Use the Table Recreation Pattern for ALTER COLUMN TYPE, DROP COLUMN, DROP CONSTRAINT, or MODIFY PRIMARY KEY. This is a destructive workflow that requires user confirmation at each step. Every generated DDL in the pattern (CREATE new, INSERT ... SELECT, DROP old, RENAME) MUST be validated with dsql_lint(sql=..., fix=true) before execution.

MUST load ddl-migrations/overview.md before attempting any of these operations.

Workflow 8: Validate and Migrate to DSQL

MUST load dsql-lint.md before running dsql_lint. Run dsql_lint(sql=source_sql, fix=true) to validate and auto-convert. For MySQL-origin SQL, MUST cross-check against mysql-migrations/type-mapping.md even when lint returns clean. On parse_error, fall back to manual conversion then re-lint.

Workflow 9: Query Plan Explainability

Explains why the DSQL optimizer chose a particular plan. Triggered by slow queries, high DPU, unexpected Full Scans, or plans the user doesn't understand. REQUIRES a structured Markdown diagnostic report as the deliverable.

MUST load all four reference files at Phase 0: query-plan/plan-interpretation.md, query-plan/catalog-queries.md, query-plan/guc-experiments.md, query-plan/report-format.md. The phase procedures (capture plan, gather evidence, experiment, produce report) are defined in those files.

Safety. Plan capture uses readonly_query exclusively. Rewrite DML to SELECT for plan capture. MUST NOT use transact --allow-writes for plan capture.

Workflow 10: Full PostgreSQL → DSQL Schema Migration

MUST load pg-migrations/type-mapping.md and pg-migrations/schema-objects.md. Run dsql_lint(fix=true) first for mechanical fixes, then apply semantic conversions from the pg-migrations references for unfixable diagnostics and patterns the linter cannot handle. Re-lint the final output before deploying.

Workflow 11: ORM Migration (Django/Hibernate/Rails)

Load orm-guides/overview.md for adapter names and framework-specific gotchas.

Error Scenarios

  • awsknowledge returns no results: Use the default limits in the table above and note that limits should be verified against DSQL documentation.

  • dsql_lint unavailable or timing out: See the Error Handling section of dsql-lint.md. Do not silently skip validation — inform the user and require explicit confirmation before proceeding with manual rules from development-guide.md.

  • OCC serialization error: Retry the transaction. If persistent, check for hot-key contention — see troubleshooting.md.

  • Transaction exceeds limits: Split into batches under 3,000 rows — see batched-migration.md.

  • Token expiration mid-operation: Generate a fresh IAM token — see authentication-guide.md. See troubleshooting.md for other issues.

Additional Resources

Files

references/onboarding.md

Aurora DSQL Get Started Guide

Overview

This guide provides steps to help users get started with Aurora DSQL in their project. It sets up their DSQL cluster with IAM authentication and connects their database to their code by understanding the context within the codebase.

Use Case

These guidelines apply when users say "Get started with DSQL" or similar phrases. The user's codebase may be mature (with existing database connections) or have little to no code - the guidelines should apply to both cases.

Contents

  • Overview

  • Use Case

  • Agent Communication Style

  • Get Started with DSQL (Interactive Guide) — 10-step linear walkthrough

  • DSQL Best Practices

  • Additional Resources

Agent Communication Style

Keep all responses succinct:

  • ALWAYS tell the user what you did.

    • Responses MUST be concise and concrete.

    • ALWAYS contain descriptions to necessary steps.

    • ALWAYS remove unnecessary verbiage.

    • Example:

      • "Created an inventory table with 4 columns"

      • "Updated the product column to be NOT NULL"

  • Ask direct questions when needed:

    • ALWAYS ask clarifying questions to avoid inaccurate assumptions

    • User ambiguity SHOULD result in questions.

    • MUST clarify incompatible user decisions

    • Example:

      • "What column names would you like in this table?"

      • "What is the column name of the primary key?"

      • "Should this column be JSONB or JSON? (JSONB is recommended for queryable structured data.)"

Examples:

  • Good: "Generated auth token. Ready to connect with psql?"

  • Bad: "I'm going to generate an authentication token using the AWS CLI which will allow you to connect to your database. This token will be valid for..."


Get Started with DSQL (Interactive Guide)

TRIGGER PHRASE: When the user says "Get started with DSQL", "Get started with Aurora DSQL", or similar phrases, provide an interactive onboarding experience by following these steps:

Before starting: Let the user know they can pause and resume anytime by saying "Continue with DSQL setup" if they need to come back later.

RESUME TRIGGER: If the user says "Continue with DSQL setup" or similar, check what's already configured (AWS credentials, clusters, MCP server, connection tested) and resume from where they left off. Ask them which step they'd like to continue from or analyze their setup to determine automatically.

Step 1: Verify Prerequisites

Check AWS credentials:

aws sts get-caller-identity

If not configured:

  • Guide them through aws configure

  • MUST verify IAM permissions include dsql:CreateCluster, dsql:GetCluster, dsql:DbConnectAdmin

  • Recommend AmazonAuroraDSQLConsoleFullAccess managed policy

Check PostgreSQL client:

psql --version

**If missing OR version <=14:** DSQL requires SNI support from psql >=14.

  • macOS: brew install postgresql@17

  • Linux (Debian/Ubuntu): sudo apt-get install postgresql-client

  • Linux (RHEL/CentOS/Amazon Linux):

    sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
    sudo yum install -y postgresql17
Step 2: Check for Existing Clusters

Set region (uses AWS_REGION or REGION if set, defaults to us-east-1):

REGION=${AWS_REGION:-${REGION:-us-east-1}}
echo $REGION

List clusters in the region:

aws dsql list-clusters --region $REGION

If they have NO clusters:

  • Ask: "Would you like to create a new DSQL cluster in $REGION or a different region?"

    • If yes, proceed to create single-region cluster

    • If they want different region, ask which one and update REGION variable

If they have ANY clusters:

  • List ALL cluster identifiers with creation dates and status

  • Ask: "Would you like to use one of these clusters or create a new one?"

    • If using existing, proceed to Step 3.

    • If creating new:

      • "Which region would you like to create a enw cluster in?"

      • Immediately update REGION variable

  • Confirm all selections before proceeding.

Create cluster command (if needed):

aws dsql create-cluster --region $REGION --tags '{"Name":"my-dsql-cluster","created_by":"<model-id>"}'

Wait for ACTIVE status (takes ~60 seconds):

aws dsql get-cluster --identifier CLUSTER_ID --region $REGION
Step 3: Get Cluster Connection Details

Construct cluster endpoint:

CLUSTER_ID="<selected-cluster-id>"
CLUSTER_ENDPOINT="${CLUSTER_ID}.dsql.${REGION}.on.aws"
echo $CLUSTER_ENDPOINT

Store endpoint for their project environment:

  • Check for .env file or environment config

  • Add or update: DSQL_ENDPOINT=<endpoint>

  • Add region: AWS_REGION=$REGION

  • ALWAYS try reading .env first before modifying

  • If file is unreadable, use: echo "DSQL_ENDPOINT=$CLUSTER_ENDPOINT" >> .env

Step 4: Set Up MCP Server (Optional)

Would the user like to be guided through setting up the MCP server?

If so, follow the steps detailed in mcp-setup.md

MCP server provides:

  • Direct query execution from agent

  • Schema exploration tools

  • Simplified database operations

Step 5: Test Connection

Generate authentication token and connect:

export PGPASSWORD=$(aws dsql generate-db-connect-admin-auth-token \
  --region $REGION \
  --hostname $CLUSTER_ENDPOINT \
  --expires-in 3600)

export PGSSLMODE=require
export PGAPPNAME="<app-name>/<model-id>"

psql --quiet -h $CLUSTER_ENDPOINT -U admin -d postgres

Verify with test query:

SELECT current_database(), version();

If connection fails:

  • Check token expiration (regenerate if needed)

  • Verify SSL mode is set

  • Confirm cluster is ACTIVE

  • Check IAM permissions

Step 6: Understand the Project

First, check if this is an empty/new project:

  • Look for existing source code, routes, or application logic

  • Check if it's just minimal boilerplate

If empty or near-empty project:

  • Ask briefly (1-2 questions): What are they building? Any specific tech preferences?

  • Remember context for subsequent steps

If established project:

  • Skip questions - infer from codebase

  • Check for existing database code or ORMs

  • Update relevant code to use DSQL

ALWAYS reference ./development-guide.md before making schema changes

Step 7: Install Database Driver

Based on their language, install appropriate driver (some examples):

JavaScript/TypeScript:

npm install @aws-sdk/credential-providers @aws-sdk/dsql-signer pg tsx
npm install @aws/aurora-dsql-node-postgres-connector

Python:

pip install psycopg2-binary
pip install aurora-dsql-python-connector

Go:

go get github.com/jackc/pgx/v5

Rust:

cargo add sqlx --features postgres,runtime-tokio-native-tls
cargo add aws-sdk-dsql tokio --features full

For implementation patterns, reference ./dsql-examples.md and ./language.md

Step 8: Schema Setup

Check for existing schema:

  • Search for .sql files, migration folders, ORM schemas (Prisma, Drizzle, TypeORM)

If existing schema found:

  • Show what you found

  • Ask: "Found existing schema definitions. Want to migrate these to DSQL?"

  • If yes, MUST verify DSQL compatibility:

    • No SERIAL types (use GENERATED AS IDENTITY with sequences, or UUID)

    • No foreign keys (implement in application)

    • Serialize arrays as JSONB; expand at query time with jsonb_array_elements_text(data)

    • For structured data, prefer JSONB over JSON for queryable fields

    • Verify column types against the supported data types list

    • Reference ./development-guide.md for full constraints

If no schema found:

  • Ask if they want to:

    1. Create simple example table

    2. Design custom schema together

    3. Skip for now

If creating example table:

Use MCP server or psql to execute:

CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  email VARCHAR(255) UNIQUE NOT NULL,
  name VARCHAR(255),
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX ASYNC idx_users_email ON users(email);

For custom schema:

  • Ask about their app's needs

  • Design tables following DSQL constraints

  • Reference ./dsql-examples.md for patterns

  • ALWAYS use CREATE INDEX ASYNC for all indexes

Step 9: Set Up Scoped Database Roles

Recommend creating scoped roles before application development begins.

  • Ask: "Would you like to set up scoped database roles for your application? This is recommended over using admin directly."

  • If yes, follow access-control.md for detailed guidance

  • At minimum, guide creating one application role:

-- As admin
CREATE ROLE app_user WITH LOGIN;
AWS IAM GRANT app_user TO 'arn:aws:iam::<account-id>:role/<AppIAMRole>';
GRANT USAGE ON SCHEMA public TO app_user;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO app_user;
  • If the application handles sensitive user data, recommend a separate schema:

CREATE SCHEMA users_schema;
GRANT USAGE ON SCHEMA users_schema TO app_user;
GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA users_schema TO app_user;
GRANT CREATE ON SCHEMA users_schema TO app_user;
  • After setup, application connections should use generate-db-connect-auth-token (not the admin variant)

Step 10: What's Next

Let them know you're ready to help with more:

"You're all set! Here are some things I can help with - feel free to ask about any of these (or anything else):

  • Schema design and migrations following DSQL best practices

  • Writing queries with proper tenant isolation

  • Connection pooling and token refresh strategies

  • Multi-region cluster setup for high availability

  • Performance optimization with indexes and query patterns

  • Setting up additional scoped roles for different services"

Important Notes:
  • ALWAYS be succinct - guide step-by-step without verbose explanations

  • ALWAYS check ./development-guide.md before schema operations

  • ALWAYS use MCP tools for queries when available (with user permission)

  • ALWAYS track MCP status throughout the session

  • ALWAYS validate DSQL compatibility for existing schemas

  • ALWAYS provide working, tested commands

  • MUST handle token expiration gracefully (15-minute default, 1-hour recommended)

MCP Server Workflow:

  • If MCP enabled: Use MCP tools for database operations, continuously update user on cluster state

  • If MCP not enabled: Provide CLI commands and manual SQL queries

  • Agent must adapt workflow based on MCP availability


DSQL Best Practices

Critical Constraints

ALWAYS follow these rules:

  1. Indexes: Use CREATE INDEX ASYNC - synchronous index creation not supported

  2. Arrays: Serialize as JSONB; expand at query time with jsonb_array_elements_text(data)

  3. Referential Integrity: Implement foreign key validation in application code

  4. DDL Operations: Execute one DDL per transaction, no mixing with DML

  5. Transaction Limits: Maximum 3,000 row modifications, 10 MiB data size per transaction

  6. Token Refresh: Regenerate auth tokens before 15-minute expiration

  7. SSL Required: Always set PGSSLMODE=require or sslmode=require

DSQL-Specific Features

Leverage Aurora DSQL capabilities:

  1. Serverless: True scale-to-zero with consumption-based pricing

  2. Distributed: Active-active writes across multiple regions

  3. Strong Consistency: Immediate read-your-writes across all regions

  4. IAM Authentication: No password management, automatic token rotation

  5. PostgreSQL Compatible: Supports 12 Database Drivers, 4 ORMs, and 3 Adapters/Dialects as listed.

For detailed patterns, see ./development-guide.md

Additional Resources

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an MCP server, Needs Python, Needs Node.js

Security

What our scanner noticed· Low risk

  • Instructions that use the network
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Cline
Publisher
Cline (Official)
Source
cline/skills · skills/dsql · commit 2637846
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Cline.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download dsql.zip