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-db-anub

v0.2.4

Published

n8n node for Cloudflare D1 Manager Worker API - Manage D1 databases with select, insert, update, delete, and more

Readme

n8n-nodes-db-anub

npm version License: MIT

An n8n community node for interacting with Cloudflare D1 databases via the D1 Manager Worker API.

🚀 Features

  • Full CRUD Operations: Select, Insert, Update, Delete records
  • Advanced Queries: JOINs, WHERE conditions, ORDER BY, GROUP BY, LIMIT/OFFSET
  • Aggregate Functions: Count and Exists operations
  • Raw SQL: Execute custom SQL queries
  • Batch Operations: Execute multiple statements atomically
  • Database Discovery: List all configured D1 database bindings
  • Secure Authentication: API key-based authentication
  • AI-Ready: Usable as a tool in n8n AI workflows

📦 Installation

Via n8n Community Nodes (Recommended)

  1. Go to Settings > Community Nodes
  2. Select Install
  3. Enter n8n-nodes-db-anub
  4. Select Install

Via npm

npm install n8n-nodes-db-anub

Manual Installation

# Clone or download this repository
cd n8n-nodes-db-anub
npm install
npm run build
npm link

# In your n8n custom directory
mkdir -p ~/.n8n/custom
cd ~/.n8n/custom
npm init -y
npm link n8n-nodes-db-anub

🔧 Prerequisites

  1. D1 Manager Worker deployed to Cloudflare Workers
  2. API Key configured in your worker
  3. D1 Database bindings configured in your worker

See the D1 Manager Worker API documentation for setup instructions.

🔐 Credentials Setup

  1. In n8n, go to Credentials > Add Credential
  2. Search for D1 Manager API
  3. Enter:
    • Base URL: Your worker URL (e.g., https://your-worker.your-subdomain.workers.dev)
    • API Key: Your API key for authentication
  4. Click Save

📖 Operations

Resource: Record

Perform CRUD operations on database tables.

Select

Retrieve records from a table with optional filtering, ordering, and pagination.

| Field | Type | Description | | ---------------- | ------- | --------------------------------------------------------------------- | | Database | Select | D1 database binding (dropdown list - auto-populated from your worker) | | Table | String | Target table name | | Columns | String | Comma-separated columns (default: *) | | Distinct | Boolean | Return distinct rows only | | Where Conditions | JSON | WHERE condition tree | | Joins | JSON | Array of JOIN clauses | | Order By | JSON | Array of order clauses | | Group By | JSON | Array of columns to group by | | Limit | Number | Maximum rows to return | | Offset | Number | Rows to skip |

Example Where Conditions:

{
  "column": "status",
  "op": "=",
  "value": "active"
}

Nested conditions:

{
  "and": [
    { "column": "status", "op": "=", "value": "active" },
    {
      "or": [
        { "column": "score", "op": ">", "value": 100 },
        { "column": "score", "op": "is null" }
      ]
    }
  ]
}

Example Joins:

[
  { "type": "inner", "table": "orders", "on": "users.id = orders.user_id" }
]

Example Order By:

[
  { "column": "created_at", "dir": "desc" },
  { "column": "name", "dir": "asc" }
]

Insert

Insert one or multiple records into a table.

| Field | Type | Description | | -------- | ------ | ----------------------------------- | | Database | Select | D1 database binding (dropdown list) | | Table | String | Target table name | | Data | Fields | Add column name and value pairs |

Data Field:

  • Click "Add Column" to add a new column
  • Enter the column name and its value
  • Add as many columns as needed

Example: | Column Name | Value | | ----------- | ----------------- | | name | Alice | | email | [email protected] | | active | true |

Update

Update records in a table.

| Field | Type | Description | | ---------------- | ------ | ------------------------------------------------ | | Database | Select | D1 database binding (dropdown list) | | Table | String | Target table name | | Data | Fields | Column values to update (add column/value pairs) | | Where Conditions | JSON | WHERE condition tree |

Delete

Delete records from a table.

| Field | Type | Description | | ---------------- | ------ | ------------------------ | | Database | String | D1 database binding name | | Table | String | Target table name | | Where Conditions | JSON | WHERE condition tree |

Count

Count records in a table.

| Field | Type | Description | | ---------------- | ------ | ----------------------------------- | | Database | Select | D1 database binding (dropdown list) | | Table | String | Target table name | | Where Conditions | JSON | WHERE condition tree (optional) |

Exists

Check if records exist in a table.

| Field | Type | Description | | ---------------- | ------ | ----------------------------------- | | Database | Select | D1 database binding (dropdown list) | | Table | String | Target table name | | Where Conditions | JSON | WHERE condition tree |

Resource: Raw SQL

Execute custom SQL queries.

| Field | Type | Description | | --------- | ------ | ----------------------------------- | | Database | Select | D1 database binding (dropdown list) | | SQL Query | String | Raw SQL to execute |

Example:

CREATE TABLE IF NOT EXISTS users (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL,
  email TEXT UNIQUE,
  created_at TEXT DEFAULT CURRENT_TIMESTAMP
)

Resource: Batch

Execute multiple statements atomically in a single transaction.

| Field | Type | Description | | ---------- | ------ | ----------------------------------- | | Database | Select | D1 database binding (dropdown list) | | Statements | JSON | Array of action objects |

Example:

[
  {
    "action": "insert",
    "table": "orders",
    "data": { "user_id": 1, "total": 99.99, "status": "pending" }
  },
  {
    "action": "update",
    "table": "users",
    "data": { "order_count": 5 },
    "where": { "column": "id", "op": "=", "value": 1 }
  }
]

Resource: Database

List all configured D1 database bindings.

📤 Response Format

All responses follow this structure:

Success:

{
  "success": true,
  "data": { ... },
  "meta": {
    "rows_read": 5,
    "rows_written": 0,
    "duration_ms": 12
  }
}

Error:

{
  "success": false,
  "error": {
    "message": "Human-readable description",
    "code": "MACHINE_READABLE_CODE"
  }
}

🔒 Supported WHERE Operators

| Operator | Description | | -------------------------------------------- | ---------------------------------------- | | =, !=, <> | Equality | | <, <=, >, >= | Comparison | | like, not like | Pattern matching | | glob | SQLite GLOB | | regex, not regex, regexp, not regexp | Regular expression | | is arabic, not arabic | Arabic character range [\u0600-\u06FF] | | in, not in | Set membership | | between | Range | | is null, is not null | Null checks |

Arabic & Regex Filter Example:

{
  "where": {
    "and": [
      { "column": "ar", "op": "not arabic" },
      { "column": "title", "op": "regex", "value": "[\\u0600-\\u06FF]" }
    ]
  }
}

🛠️ Development

# Install dependencies
npm install

# Build the node
npm run build

# Development mode with watch
npm run dev

# Lint code
npm run lint
npm run lint:fix

📝 License

MIT

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📚 Related

❓ Support

If you encounter any issues or have questions, please open an issue on GitHub.