Registry / database / mirabow-sql

mirabow-sql

JSON →
library0.0.20jsnpmunverified

A SQL parser built on top of the MIRABOW parsing library, designed to parse standard SQL and SQLite dialects. Current version is 0.0.20, with a low release cadence. Key differentiators include support for multiple SQL statements, ability to extract specific parts via matchers (e.g., SELECT, UPDATE, DELETE), and TypeScript support with no runtime dependencies beyond the core MIRABOW library. Works in browser and Node.js environments.

npm install mirabow-sql
INSTALL
IMPORT
SIG · MIRABOW-SQL
M
mirabow-sql
databasejavascriptv0.0.20
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.

statementsMatcher
import { statementsMatcher } from 'mirabow-sql'
import { statementsMatcher } from 'mirabow'
Matcher functions are exported from 'mirabow-sql', not from 'mirabow'. This is the primary matcher for multiple SQL statements.
execute
import { execute } from 'mirabow'
import { execute } from 'mirabow-sql'
The execute function is part of the core 'mirabow' package, not 'mirabow-sql'.
statementsKey
import { statementsKey } from 'mirabow-sql'
const { statementsKey } = require('mirabow-sql')
Use ESM import. Key objects are only available via named imports from 'mirabow-sql'.

Parses a SELECT SQL statement using statementsMatcher and extracts selected columns and table name.

import { execute } from 'mirabow' import { statementsMatcher, selectKey } from 'mirabow-sql' const data = 'select name, age from users where id = 1;' const result = execute(statementsMatcher(), data) if (result.isOk) { const scope = result.capture['sql-statement-scope'] const firstStatement = scope[0] const selectedColumns = firstStatement[selectKey.select] const fromTable = firstStatement[selectKey.from] console.log('Columns:', selectedColumns) console.log('Table:', fromTable) } else { console.error('Parsing failed') }
Debug
Known issues
breakingRequires mirabow package as a peer dependency
fix
Install both packages: npm install mirabow mirabow-sql
affects: >=0.0.1
deprecatedThe capture keys may change in future versions (e.g., 'sql-statement-scope' is not exported as a constant)
fix
Use provided Key objects (like selectKey, statementKey) instead of hardcoding string keys
affects: >=0.0.1 <1.0.0
gotchaMatcher functions return a matcher object; must be called every time you execute: execute(statementsMatcher(), data)
fix
Always invoke the matcher function (e.g., statementsMatcher()) inside execute, not pass the function reference.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot find module 'mirabow'
Missing core mirabow package
fix
Run 'npm install mirabow' alongside mirabow-sql
TypeError: execute is not a function
Importing execute from 'mirabow-sql' instead of 'mirabow'
fix
Change import to: import { execute } from 'mirabow'
Property 'isOk' does not exist on type '{}'
Not using the correct TypeScript type for execute result
fix
Import ExecuteResult type from 'mirabow': import { ExecuteResult } from 'mirabow'
Upgrade
Version history
0.0.20latest on npm
Audit
Dependencies
mirabowrequiredCore parsing engine required for execution
Agent activity
3 hits · last 30 days
node
2
Resources
mirabow-sql — npm install mirabow-sql · libregistry