Registry / database / sqloflow

sqloflow

JSON →
library0.1.4jsnpmunverified

Early-stage SQL visualization library for generating data flow diagrams from SQL queries. Current stable version 0.1.4, released August 2024, with monthly or slower cadence. Supports multiple output formats (Mermaid, ASCII, GraphViz DOT, JSON), schema inference, and column-level tracking. Differentiates via detailed flow diagrams rather than simple AST trees, works as CLI and library with browser compatibility.

npm install sqloflow
INSTALL
IMPORT
SIG · SQLOFLOW
S
sqloflow
databasejavascriptv0.1.4
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.

parse
import { parse } from 'sqloflow'
const parse = require('sqloflow')
ESM-only package; no CommonJS require support.
convert
import { convert } from 'sqloflow'
import sqloflow from 'sqloflow'
Named export, not default.
render
import { render } from 'sqloflow'
import { Render } from 'sqloflow'
CamelCase render function, not PascalCase.

Parses a SQL file, converts to DOT format, and renders the diagram string using sqloflow library.

import { parse, convert, render } from 'sqloflow'; import { readFileSync } from 'fs'; const sql = readFileSync('query.sql', 'utf8'); const parsed = parse(sql); const dot = convert(parsed, { format: 'dot' }); const output = render(dot, { format: 'dot' }); console.log(output);
Debug
Known issues
gotchaparse() returns an object with an 'ast' property, not the AST directly.
fix
Use parsed.ast instead of parsed directly when passing to convert().
affects: >=0.1.0
deprecatedrender() with format 'mermaid' may produce Mermaid that is not fully compatible with all Mermaid renderers (e.g., missing node IDs).
fix
Use format 'dot' or 'json' for reliable output, or check Mermaid version compatibility.
affects: >=0.1.0
gotchaCLI `sqloflow` command may conflict with global installs of other tools named `sqloflow` (unlikely). Prefer `npx sqloflow`.
fix
Use npx sqloflow to avoid path issues.
affects: >=0.1.0
gotchaSchema inference may be inaccurate for queries without explicit column references (e.g., SELECT *).
fix
Use explicit column lists in SQL for best results.
affects: >=0.1.0
gotchaThe library does not support all SQL dialects; only postgresql, mysql, sqlite, mariadb, transactsql are supported via the '-d' flag or 'dialect' option.
fix
Ensure your SQL dialect is one of the supported ones; for others, parse may fail or produce incorrect output.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'sqloflow'
Package not installed or import path incorrect in ESM context.
fix
Install package with 'npm install sqloflow' and use ESM import syntax.
TypeError: (0 , sqloflow.parse) is not a function
Using CommonJS require instead of ESM import.
fix
Change to 'import { parse } from "sqloflow"' and ensure project uses ESM (e.g., type: module in package.json).
Error: No SQL parser found for dialect 'bigquery'
Unsupported SQL dialect.
fix
Use a supported dialect: postgresql, mysql, sqlite, mariadb, or transactsql.
Upgrade
Version history
0.1.4latest on npm
Audit
Dependencies
node-sql-parserrequiredSQL parsing backend
Agent activity
16 hits · last 30 days
node
12
Meta
2
OpenAI (training)
1
Resources
sqloflow — npm install sqloflow · libregistry