npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-advanced-sql

v0.1.0

Published

n8n community node: run SQL against Microsoft SQL/Azure SQL and PostgreSQL with pluggable enterprise authentication (Azure Managed Identity, service principal, OAuth2, certificate, API key, password).

Readme

n8n-nodes-advanced-sql

An n8n community node for running SQL against Microsoft SQL / Azure SQL and PostgreSQL with a pluggable enterprise authentication layer — Azure Managed Identity, service principal, OAuth2 client credentials, certificate/JWT bearer, static access token, and legacy username/password.

It is a backward-compatible superset of the built-in SQL nodes: existing username/password usage keeps working unchanged, and modern auth is opt-in per credential.

Highlights

  • 🔐 Azure Managed Identity via the official @azure/identity (ManagedIdentityCredential, with opt-in DefaultAzureCredential fallback for local dev).
  • 🧩 Pluggable auth strategies — one class per method, selected by a credential discriminator.
  • ♻️ Token caching + refresh with single-flight and a 5-minute expiry skew.
  • 🛡️ Secrets never logged or emitted in node output; TLS on by default.
  • 🔄 Fully backward compatible; legacy credentials map 1:1.

Install (self-hosted n8n)

npm install n8n-nodes-advanced-sql
# then install the driver(s) you use (they are optional peer deps):
npm install mssql   # Microsoft SQL / Azure SQL
npm install pg      # PostgreSQL

Set N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE / register the community package per the n8n community nodes docs.

Develop

npm install
npm run build     # tsc + copy icons/codex into dist/
npm test          # jest unit + node-execute tests
npm run lint

Project layout

credentials/AdvancedSqlApi.credentials.ts   Credential type (multi-auth, displayOptions-gated)
nodes/AdvancedSql/AdvancedSql.node.ts        Node definition + execute()
nodes/AdvancedSql/auth/                       Pluggable auth strategy layer
  factory.ts            authType -> strategy
  TokenCache.ts         in-memory single-flight token cache (5-min skew)
  redact.ts             secret scrubbing for output/errors
  strategies/           Password, ManagedIdentity, ServicePrincipal,
                        OAuth2ClientCredentials, Certificate, ApiKey
nodes/AdvancedSql/db/                          Driver layer (lazy-loaded)
  pool.ts               fingerprinted pool manager + token rotation
  query.ts              parameterised query execution + result mapping
  builders.ts           safe INSERT/UPDATE/DELETE builders
tests/                                         Jest suites (34 tests)

Documentation

The complete engineering design — architecture, credential/node schema, per-method auth flows, sample implementation code, security model, and the test plan — lives in DESIGN.md.

A ready-to-import example workflow (Managed Identity → Azure SQL) is in examples/advanced-sql-managed-identity.workflow.json.

Status

Working implementation. The package builds (npm run build) and its test suite passes (npm test, 34 tests). Integration tests against live Azure SQL / SQL Server / Postgres are outlined in DESIGN.md §6.2.