Registry / database / mini-sql

mini-sql

JSON →
library0.22.3jsnpmunverified

A minimal SQL interpreter written in JavaScript, using the jiwson parser generator for ES6 compatibility. Version 0.22.3 is the current stable release; the package is updated infrequently. It provides a simple interface to parse and execute basic SQL statements like SELECT, INSERT, UPDATE, and DELETE. Unlike full-fledged databases or query builders, mini-sql is lightweight and works purely in-memory, making it suitable for educational purposes or small-scale tooling where a full SQL engine is overkill.

database
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.

Package is ESM-only and ships default export

import parser from 'mini-sql'

Named export 'parse' also available, but default export is the parser instance.

import { parse } from 'mini-sql'

The class constructor is exported as 'Parser'.

import { Parser } from 'mini-sql'

Shows how to import the default parser, parse a SELECT query, and handle parse errors.

import parser from 'mini-sql'; const sql = 'SELECT name, age FROM users WHERE age > 18'; try { const result = parser.parse(sql); console.log(result); } catch (err) { console.error('Parse error:', err.message); }
Debug
Known footguns
deprecatedThe 'parse' function is deprecated and will be removed in next major version. Use 'parser.parse()' instead.
gotchaMini-sql does not support JOINs or subqueries. Attempting to parse such SQL throws a parse error.
breakingIn version 0.20.0, the API changed from callback-based to sync return values. Older code expecting callbacks will break.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
6 hits · last 30 days
gptbot
3
Resources