azure-postgres-ts
Skill by sickn33
Shows Node.js and TypeScript developers how to connect to Azure Database for PostgreSQL Flexible Server with the pg (node-postgres) package. It covers password and Microsoft Entra ID passwordless sign-in.
Install azure-postgres-ts
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/azure-postgres-ts ~/.claude/skills/azure-postgres-tsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/azure-postgres-ts ~/.gemini/antigravity-cli/skills/azure-postgres-tsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill explains how to connect a Node.js or TypeScript app to Azure Database for PostgreSQL Flexible Server using the pg (node-postgres) package. It covers two sign-in methods: password authentication, and Microsoft Entra ID passwordless authentication, which uses @azure/identity to get an access token. It also includes examples for a single client, a connection pool, parameterized queries, transactions, typed query results and error handling by PostgreSQL error code.
The source says the examples are separate sketches. They need their own imports and schema and should only be run against an authorized non-production database. It recommends Entra ID authentication and SSL with rejectUnauthorized set to true. The skill is aimed at developers building services that store data in Azure PostgreSQL. Its metadata marks the risk level as critical.
Written from the project's SKILL.md and checked against it.
What it can do
- Password authenticationConnects to Azure PostgreSQL with a username and password from environment variables.
- Entra ID passwordless authenticationGets an access token with DefaultAzureCredential and uses it as the connection password.
- Connection poolingShows a pg Pool setup with max, idle and connection timeout settings.
- Parameterized queriesUses $1 placeholders so user input is passed as values, not concatenated into SQL.
- TransactionsShows BEGIN, COMMIT and ROLLBACK, plus a reusable withTransaction helper.
- Typed query resultsUses TypeScript generics to type query rows, such as a User interface.
- Error handling by codeMaps PostgreSQL error codes such as 23505 and 28P01 to clearer messages.
- Pool token refreshUses a password callback so new connections get a current Entra ID token.
What you need
- Node.js
- TypeScript
- pg (node-postgres) package
- @azure/identity package for Entra ID sign-in
- Azure Database for PostgreSQL Flexible Server
Try asking
- Show me how to connect to Azure PostgreSQL with Entra ID from Node.js
- Write a withTransaction helper for my pg pool
- Add pool settings for a production Azure PostgreSQL app
Good to know
- Examples are sketches that need imports, a schema and an authorized non-production database.
- Azure PostgreSQL connection limits depend on the SKU, according to the source.
- Entra ID tokens are secrets and should never be logged.
- The source gives the Entra ID token lifetime as about one hour, but notes the issuer sets expiry.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/azure-postgres-ts/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md12 KB
Alternatives to azure-postgres-ts
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
azure-postgres-ts: common questions
Does this skill support passwordless login to Azure PostgreSQL?
Yes. It shows Microsoft Entra ID authentication using DefaultAzureCredential and the Azure PostgreSQL token scope, and it recommends this option.
Which package does it use to connect?
It uses the pg (node-postgres) package, with @types/pg for TypeScript types and @azure/identity for Entra ID tokens.
Does it protect against SQL injection?
It recommends parameterized queries and says parameter binding protects values, not identifiers or tenant authorization.
How do I install azure-postgres-ts?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is azure-postgres-ts free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is azure-postgres-ts safe to use?
It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to azure-postgres-ts?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
