Registry / database / ipsql
library1.2.18jsnpmunverified

A decentralized SQL database that runs on IPFS, implementing SQL schema, data model, and query language. Currently at v1.2.18 in pre-alpha stage with heavy active development and frequent breaking changes. Not production-ready. Uses chunky-trees for ordered search indexes and IPLD for data structures. Supports CREATE/INSERT/UPDATE/SELECT with WHERE, ORDER BY, aggregation functions (MIN, MAX, COUNT, AVG, SUM), optional encryption, and DAG tables (JSON-like unstructured rows). Key differentiator: every operation produces deltas and proofs for replication as hash-linked blocks. Does NOT yet support full SQL (e.g., JOIN, GROUP BY, DELETE without WHERE, DATE types).

npm install ipsql
INSTALL
IMPORT
SIG · IPSQL
I
ipsql
databasejavascriptv1.2.18
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.

IPSQL
import IPSQL from 'ipsql'
const ipsql = require('ipsql')
CommonJS require is not officially supported; use ESM imports.
Database
import { Database } from 'ipsql'
Type is available for TypeScript users. Not a named export in all versions; check docs.
default import
import ipsql from 'ipsql'
import { ipsql } from 'ipsql'
Default export is the main object, not a named export called 'ipsql'.

Creates an in-memory or IPFS-based database, adds a table, inserts rows, and queries all rows.

import IPSQL from 'ipsql'; async function main() { const db = await IPSQL.create('test.db'); const createTable = "CREATE TABLE users (id INTEGER, name VARCHAR(100))"; await db.query(createTable); await db.query("INSERT INTO users (id, name) VALUES (1, 'Alice')"); await db.query("INSERT INTO users (id, name) VALUES (2, 'Bob'"); const result = await db.query("SELECT * FROM users"); console.log(result); } main().catch(console.error);
Debug
Known issues
breakingAPI is unstable and changing frequently without notice; do not use in production.
fix
Wait for stable release or pin a specific commit. Check changelog before upgrading.
affects: <2.0.0
gotchaDELETE without WHERE clause deletes the entire table, not all rows.
fix
Use 'DELETE FROM table_name WHERE ...' to delete specific rows.
affects: >=1.0.0
gotchaSome SQL features like JOIN, GROUP BY, and complex WHERE conditions are not implemented.
fix
Check the SQL feature checklist in README before writing queries.
affects: >=1.0.0
deprecatedThe CLI may be removed or changed in future versions as the JS API becomes the main interface.
fix
Transition to using the Node API programmatically.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: db.query is not a function
Using default import incorrectly (e.g., import { IPSQL } instead of import IPSQL).
fix
Use 'import IPSQL from 'ipsql' and then const db = await IPSQL.create(...);
Error: Not supported: JOIN
Attempting to use an unsupported SQL feature.
fix
Check the SQL feature checklist. JOIN is not yet implemented.
ReferenceError: module is not defined
Using CommonJS require instead of ESM import.
fix
Add 'type': 'module' to package.json or use .mjs extension; replace require with import.
Upgrade
Version history
1.2.18latest on npm
Audit
Dependencies
chunky-treesrequiredCore dependency for tree building technique used in ordered search indexes
Agent activity
4 hits · last 30 days
node
4
Resources
packageipsql
ipsql — npm install ipsql · libregistry