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
Copy file name to clipboardExpand all lines: src/content/docs/aws/services/dsql.mdx
+61-2Lines changed: 61 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Aurora DSQL is a serverless, distributed, PostgreSQL-compatible database service
13
13
It offers active-active high availability and is designed for transactional workloads that require scalability without the operational overhead of managing database infrastructure.
14
14
15
15
LocalStack allows you to use the Aurora DSQL APIs to create and manage clusters, tags, resource policies, and streams in your local environment.
16
-
The data plane is backed by an embedded PostgreSQL instance, so you can connect to a cluster and run SQL against it.
16
+
The data plane is backed by an embedded PostgreSQL instance, so you can connect to a cluster and run SQL against it, including DSQL-specific dialect such as `CREATE INDEX ASYNC` and the `sys.jobs` system view.
17
17
The supported APIs are available on our [API Coverage section](#api-coverage), which provides information on the extent of Aurora DSQL's integration with LocalStack.
Aurora DSQL is PostgreSQL wire-compatible but adds dialect-specific DDL that vanilla Postgres rejects.
272
+
LocalStack accepts the DSQL-specific statements that applications commonly rely on so DSQL-targeted apps can run against the emulator.
273
+
274
+
### Asynchronous indexes
275
+
276
+
On real Aurora DSQL, [`CREATE INDEX ASYNC`](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/working-with-create-index-async.html) (and `CREATE UNIQUE INDEX ASYNC`) submits a background index build, returns a `job_id` immediately, and records the job in the [`sys.jobs`](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/working-with-systems-tables.html) system view for the application to poll.
277
+
278
+
LocalStack accepts the same syntax.
279
+
The index is built synchronously under the hood; the observable result matches AWS: a `job_id` is returned, the index exists afterwards, and `sys.jobs` reports the job as `completed` with `job_type``INDEX_BUILD`.
280
+
281
+
Connect to the cluster as shown in [Connect to the cluster](#connect-to-the-cluster), then run:
`CREATE UNIQUE INDEX ASYNC` works the same way and enforces uniqueness once the index exists:
317
+
318
+
```sql
319
+
CREATEUNIQUE INDEXASYNC uidx_dept_manager ON departments (manager);
320
+
```
321
+
322
+
:::note
323
+
Index builds run synchronously under the hood.
324
+
Async timing (background processing, `submitted`/`processing` statuses) and the AWS 30-minute auto-cleanup of completed or failed jobs from `sys.jobs` are not modelled.
325
+
:::
326
+
269
327
## Current Limitations
270
328
271
329
- CloudFormation is not yet supported for Aurora DSQL resources.
272
330
- The data plane is backed by a standard embedded PostgreSQL instance rather than the real Aurora DSQL distributed engine.
273
-
DSQL-specific SQL dialect restrictions are not enforced, so behaviour may differ from AWS for unsupported statements.
331
+
- LocalStack accepts DSQL-specific `CREATE [UNIQUE] INDEX ASYNC` and exposes `sys.jobs` / `sys.wait_for_job`, but broader DSQL dialect restrictions (for example rejecting foreign keys or `TRUNCATE`) are not enforced, so behaviour may differ from AWS for unsupported statements.
332
+
- Asynchronous index builds complete synchronously; timing semantics and automatic cleanup of old `sys.jobs` rows are not modelled.
274
333
- Multi-region clusters are tracked at the control-plane level only.
275
334
Peering metadata is recorded, but there is no real cross-region replication.
276
335
- Data-plane data is not persisted yet. Cluster metadata survives restarts when persistence is enabled, but the data written through the embedded PostgreSQL backend (tables, rows) is not retained.
0 commit comments