azure-postgres-ts
Connect to Azure Database for PostgreSQL Flexible Server from Node.js/TypeScript using the pg (node-postgres) package.
npx skills add sickn33/agentic-awesome-skills --skill azure-postgres-ts --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Azure PostgreSQL for TypeScript (node-postgres) Connect to Azure Database for PostgreSQL Flexible Server using the `pg` (node-postgres) package with support for password and Microsoft Entra ID (passwordless) authentication. ## Installation ```bash npm install pg @azure/identity npm install -D @types/pg ``` ## Environment Variables ```bash # Required AZURE_POSTGRESQL_HOST=<server>.postgres.database.azure.com AZURE_POSTGRESQL_DATABASE=<database> AZURE_POSTGRESQL_PORT=5432 # For password authentication AZURE_POSTGRESQL_USER=<username> AZURE_POSTGRESQL_PASSWORD=<password> # For Entra ID authentication AZURE_POSTGRESQL_USER=<entra-user>@<server> # e.g., user@contoso.com AZURE_POSTGRESQL_CLIENTID=<managed-identity-client-id> # For user-assigned identity ``` ## Authentication ### Option 1: Password Authentication ```typescript import { Client, Pool } from "pg"; const client = new Client({ host: process.env.AZURE_POSTGRESQL_HOST, database: process.env.AZURE_POSTGRESQL_DATABASE, user: process.env.AZURE_POSTGRESQL_USER, password: process.env.AZURE_POSTGRESQL_PASSWORD, port: Number(process.env.AZURE_POSTGRESQL_PORT) || 5432, ssl: { rejectUnauthorized: true } // Required for Azure }); await
- Installation
- Environment Variables
- Authentication
- Option 1: Password Authentication
- Option 2: Microsoft Entra ID (Passwordless) - Recommended
- Core Workflows
- 1. Single Client Connection
- 2. Connection Pool (Recommended for Production)
- 3. Parameterized Queries (Prevent SQL Injection)
- 4. Transactions
- 5. Transaction Helper Function
- 6. Typed Queries with TypeScript
- Pool with Entra ID Token Refresh
- Error Handling
npm install pg @azure/identity npm install -D @types/pg Required For password authentication For Entra ID authentication
What does the azure-postgres-ts skill do?
Connect to Azure Database for PostgreSQL Flexible Server from Node.js/TypeScript using the pg (node-postgres) package.
How do I install it?
Run `npx skills add sickn33/agentic-awesome-skills --skill azure-postgres-ts --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.