Registry / devops / n8n-nodes-sqlite3

n8n-nodes-sqlite3

JSON →
library0.4.1jsnpmunverified

An n8n community node that integrates SQLite3 database operations into n8n workflows. Supports SELECT, INSERT, UPDATE, DELETE, and CREATE operations with automatic query type detection, parameterized queries using @param or $param syntax, and an optional spread-results mode that outputs each row as a separate item. Compatible with any n8n version supporting custom nodes. Current version 0.4.1. Key differentiators: auto-detect mode, spread results for SELECT, and a "use default bindings" option to work around musl libc issues in Alpine containers.

npm install n8n-nodes-sqlite3
INSTALL
IMPORT
SIG · N8N-NODES-SQLITE3
N
n8n-nodes-sqlite3
devopsjavascriptv0.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SqliteNode
import { SqliteNode } from 'n8n-nodes-sqlite3'
const SqliteNode = require('n8n-nodes-sqlite3')
The package exports a single node class. Use named import for ES modules; CommonJS require returns the class directly.
sqlite3
import * as sqlite3 from 'better-sqlite3'
import sqlite3 from 'sqlite3'
The n8n node internally uses better-sqlite3, not the callback-based sqlite3 module. If you need to use SQLite directly in a custom node, install better-sqlite3 separately.

Shows how to import and use the SqliteNode in an n8n custom node directory, then configure the node in a workflow with a parameterized SELECT query.

import { SqliteNode } from 'n8n-nodes-sqlite3'; // In your n8n custom nodes directory, export the node: export const nodeTypes = [ SqliteNode ]; // Usage in n8n workflow: // 1. Add SQLite node to workflow. // 2. In node settings, set Database Path to '/path/to/database.sqlite'. // 3. Write a parameterized query, e.g. "SELECT * FROM users WHERE age > @age". // 4. Provide arguments as JSON: {"age": 30}. // 5. Optionally enable 'Spread Results' to get each row as a separate output item.
Debug
Known issues
gotchaParameter syntax differs between versions: use @param (preferred) or $param (legacy). Mixing both in the same query may cause unexpected behavior.
fix
Always use @param for new queries. Update old queries from $param to @param.
affects: >=0.1.0
gotchaThe node uses better-sqlite3 which requires native compilation. Docker users on Alpine need to install build tools or use the 'use default bindings' option to work around musl libc issues.
fix
Enable 'use default bindings' in node settings. Alternatively, install gcc, g++, make, and python3 in your Dockerfile before npm install.
affects: >=0.1.0
gotchaSpread Results option only works with SELECT queries. Enabling it for INSERT/UPDATE/DELETE will still output a single item.
fix
Only enable Spread Results for SELECT queries. For other operations, leave it disabled.
affects: >=0.1.0
gotchaDatabase path is relative to the n8n process working directory, not the workflow directory. Use absolute paths for consistency.
fix
Specify full absolute path to the SQLite database file, e.g., '/data/my_database.sqlite'.
affects: >=0.1.0
gotchaAuto query type detection may misidentify queries with multiple statements or comments. Explicitly set query type to avoid errors.
fix
Manually select the query type (e.g., SELECT, INSERT) instead of AUTO when the query is complex.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'better-sqlite3'
The package better-sqlite3 is not installed or failed to compile.
fix
Run 'npm install better-sqlite3' in your n8n custom nodes directory. For Alpine, install build tools first: 'apk add --no-cache gcc g++ make python3'
Error: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory
Alpine Linux uses musl libc which better-sqlite3 does not bundle.
fix
Enable 'use default bindings' in the node settings, or rebuild better-sqlite3 from source on Alpine.
TypeError: Cannot read properties of undefined (reading 'map')
The query returned undefined instead of an array, often due to a malformed SQL statement.
fix
Check your SQL query for syntax errors. Ensure that SELECT queries return rows. Use the n8n UI to test the query.
Error: SQLITE_ERROR: near "?": syntax error
Tried to use ? placeholders instead of @param syntax.
fix
Replace ? with @param (e.g., @value) in your query, and provide arguments as a JSON object, not an array.
Upgrade
Version history
0.4.1latest on npm
Audit
Dependencies
n8n-workflowrequiredRequired to define n8n node types and interfaces
Agent activity
4 hits · last 30 days
node
4
Resources
n8n-nodes-sqlite3 — npm install n8n-nodes-sqlite3 · libregistry