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-db2-sql-builder

v0.1.0

Published

IBM Db2 SQL Builder & Executor for n8n Community Nodes

Readme

Banner image

🧱 n8n-nodes-db2-sql-builder

A powerful IBM Db2 SQL Builder community node for n8n, designed for advanced SQL execution, dynamic parameter binding, and workflow-safe query orchestration.


⚠️ IBM DB2 Node Compatibility Note

The IBM DB2 community node (using ibm_db) only works reliably on Debian-based environments with Node.js 20. ibm_db is a native Node.js addon and depends on: -- Node.js ABI version -- node-gyp toolchain -- System libraries (DB2 CLI, unixODBC, libaio, libxml2)

  • n8n hosting / n8n Cloud / installing the package directly via the n8n UI: ❌ Cannot compile native modules ❌ Missing required DB2 system libraries ❌ Results in odbc_bindings.node or NODE_MODULE_VERSION errors

  • ✅ Required Setup To use this node, you must build a custom Docker image: Base image: node:20-bookworm-slim Build ibm_db from source Bake the community node into the image This approach ensures the IBM DB2 node works correctly and consistently in n8n.

✨ Features

✅ SQL Execution

  • Execute multiple SQL queries in sequence
  • Optional transaction support (BEGIN / COMMIT / ROLLBACK)
  • Stop on error or continue execution

🔗 Parameter Binding

  • Positional parameters ?
  • Named parameters :id, :userId
  • Supports:
    • String
    • Number
    • Boolean
    • Date
    • Null
  • Dynamic bindings from previous outputs:
    WHERE id IN (${output0.COL1})
    WHERE id IN ([${output0.COL1}, 6, 1])

📦 Smart IN / BETWEEN Handling

  • Auto-expand IN (?) for arrays
  • Supports:
    col IN (?, ?, ?)
    col BETWEEN ? AND ?
  • Empty array → auto short-circuit (returns empty result safely)

🔍 Preview / Dry Run Mode

  • Validate SQL without execution
  • Shows:
    • Final SQL
    • Placeholder count
    • Bound parameters

🔄 Result Transform

  • Optional JavaScript transform
  • Access:
    • result
    • context.output0, context.output1, ...
  • Async supported

📤 Output Modes

  • All outputs
  • Merge outputs
  • Last output only
  • Specific output index

🧱 Node UI Overview

Global Options

  • Use Transaction
  • Stop On Error
  • Preview Query
  • Output Mode

Per Query

  • SQL Editor (Standard SQL)
  • Parameters (auto-hinted Parameter #1, #2…)
  • Transform Result (JS Editor)

📌 Example

SELECT *
FROM users
WHERE id IN (?)
AND created_at BETWEEN ? AND ?

Bindings:

[
  { "type": "number", "value": "[1,2,3]" },
  { "type": "date", "value": "2024-01-01" },
  { "type": "date", "value": "2024-12-31" }
]

🚀 Installation

From pnpm (recommended)

pnpm install n8n-nodes-db2-sql-builder

Manual (local development)

git clone https://github.com/tedious-code/n8n-nodes-db2-sql-builder.git
cd n8n-nodes-db2-sql-builder
pnpm install
pnpm run build

🐳 Docker + n8n

docker compose -f docker-compose.yml up -d --build

🧪 Development

pnpm run build

Clear Docker cache if UI not updating:

docker compose down -v
docker build -t n8n-nodes-db2-sql-builder .

Docker run

docker run -it --rm \                      
  --name n8n-node-db2-sql-builder \
  -p 5678:5678 \
  -e DB_TYPE=postgresdb \
  -e DB_POSTGRESDB_DATABASE= [TYPE DATABASE] \
  -e DB_POSTGRESDB_HOST= [Server host] \
  -e DB_POSTGRESDB_PORT=5432 \
  -e DB_POSTGRESDB_USER= [User ] \
  -e DB_POSTGRESDB_SCHEMA=public \
  -e DB_POSTGRESDB_PASSWORD= ******* \
  -e DB_POSTGRESDB_SSL=true \
  -e DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=false \
  -e N8N_COMMUNITY_PACKAGES_ENABLED=true \
  n8n-nodes-db2-sql-builder

⚠️ Notes

  • Empty array bindings return empty output safely
  • Preview mode disables transactions automatically

📜 License

MIT


🤝 Contributing

Pull requests welcome! If you find a bug or want a feature, open an issue.


Postgres DB serverless

https://neon.com/

⭐ Credits

Built with ❤️ for the n8n Community

More information

Refer to our documentation on creating nodes for detailed information on building your own nodes.