feat(deno): Add Deno + Aurora DSQL samples with booking API#950
Open
pyraenix wants to merge 1 commit intoaws-samples:mainfrom
Open
feat(deno): Add Deno + Aurora DSQL samples with booking API#950pyraenix wants to merge 1 commit intoaws-samples:mainfrom
pyraenix wants to merge 1 commit intoaws-samples:mainfrom
Conversation
Add Deno runtime samples for connecting to Amazon Aurora DSQL, including a basic client/ORM sample and a real-world booking API sample application. Deno is the first new runtime added to this repository that uses a native (non-Node.js) PostgreSQL driver. ## deno/deno-postgres — Basic Client/ORM Sample Simple connect-and-query example using the native deno-postgres driver (jsr:@db/postgres) with IAM token authentication over SSL verify-full. Demonstrates concurrent queries across multiple connections. Follows the same pattern as javascript/node-postgres. - src/example_preferred.ts — main example - test/example_preferred.test.ts — integration test - deno.json, deno.lock, README.md, .gitignore ## deno/booking-api/deno-postgres — Booking API Sample Application A booking/reservation REST API built with Deno.serve() and deno-postgres, backed by Aurora DSQL. Goes beyond connect-and-query to demonstrate real application patterns: - Full CRUD: POST/GET/PUT/DELETE /bookings + GET /health - IAM token authentication via @aws-sdk/dsql-signer - OCC retry handling for SQLSTATE OC000 concurrency conflicts with exponential backoff + jitter - Overlap detection for double-booking prevention within transactions (DSQL has no exclusion constraints) - Deno least-privilege permissions model (--allow-net, --allow-env, --allow-read scoped to minimum required) - Serverless-ready architecture (deno serve compatible, per-request connections, no mutable global state) - UUID primary keys via gen_random_uuid() (DSQL has no sequences) - Graceful shutdown with schema teardown on SIGINT/SIGTERM ### Testing (all verified against real Aurora DSQL cluster) - 20 property-based tests (fast-check): router dispatch, overlap detection symmetry, JSON response format, malformed JSON rejection, OCC error detection/retry/exhaustion/pass-through, token generator error formatting - 9 integration tests: full CRUD flow against real DSQL - 15 smoke tests (test-api.sh): health check, CRUD, overlap conflict, concurrent OCC conflict, validation errors, cleanup ### Documentation - Architecture diagram (ASCII art) - Create booking request flow diagram - Data model diagram - Key design decisions table for Aurora DSQL - API endpoints table with status codes - Error response examples - Deno permissions model explanation - OCC retry behavior section - Deno Deploy deployment instructions - Example curl commands for all endpoints - Project structure overview ## Root README Updated the repository root README.md to include Deno in the Client/ORM table and the booking API in the Sample Applications table. ## Technical Notes - npm:pg (node-postgres) was evaluated but does not work with Aurora DSQL from Deno due to a TLS compatibility issue in Deno's Node.js compat layer. Only the native deno-postgres driver is included. - Authentication and cluster management samples are intentionally omitted — they are pure AWS SDK calls with no Deno-specific value, matching the pattern of TypeScript and PHP samples.
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Deno runtime samples for connecting to Amazon Aurora DSQL, including a basic client/ORM sample and a real-world booking API sample application. Deno is the first new runtime added to this repository that uses a native (non-Node.js) PostgreSQL driver.
deno/deno-postgres — Basic Client/ORM Sample
Simple connect-and-query example using the native deno-postgres driver (jsr:@db/postgres) with IAM token authentication over SSL verify-full. Demonstrates concurrent queries across multiple connections. Follows the same pattern as javascript/node-postgres.
deno/booking-api/deno-postgres — Booking API Sample Application
A booking/reservation REST API built with Deno.serve() and deno-postgres, backed by Aurora DSQL. Goes beyond connect-and-query to demonstrate real application patterns:
Testing (all verified against real Aurora DSQL cluster)
Documentation
Root README
Updated the repository root README.md to include Deno in the Client/ORM table and the booking API in the Sample Applications table.
Technical Notes
By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT-0 license.
Thank you for your contribution!