Registry / database / sql-describe

sql-describe

JSON →
library0.1.13jsnpmunverified

sql-describe is a Rust-based Node.js native addon (via Neon bindings) that describes SQL queries using sqlx. The version 0.1.13 is the latest stable release. It compiles Rust to a binary .node addon, providing high performance and direct SQL analysis. Differentiators: leverages sqlx's query analysis capabilities at Rust speed; exposes an async describe() function that returns detailed query metadata including parameters, columns, and types.

npm install sql-describe
INSTALL
IMPORT
SIG · SQL-DESCRIBE
S
sql-describe
databasejavascriptv0.1.13
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.

describe
import { describe } from 'sql-describe'
const describe = require('sql-describe').describe
ESM module. Default export is not available.
initRustEngine
import { initRustEngine } from 'sql-describe'
require('sql-describe').initRustEngine()
Async function; must be awaited.
Parameters
import type { Parameters } from 'sql-describe'
Type-only import for TypeScript users.

Demonstrates importing and calling the describe function to analyze a SQL query with a parameter placeholder.

import { describe } from 'sql-describe'; const query = 'SELECT id, name FROM users WHERE age > $1'; try { const result = await describe(query); console.log('Query parameters:', result.parameters); console.log('Columns:', result.columns); } catch (err) { console.error('Failed to describe query:', err); }
Debug
Known issues
gotchadescribe() is async and returns a Promise; must be awaited or used with .then().
fix
Use await or .then() on the returned promise.
affects: >=0.1.0
breakingIn version 0.2.0, the parameter placeholder syntax changed from $1 to ?.
fix
Update queries to use ? instead of $1.
affects: >=0.2.0
gotchaThe module is a native addon; requires Node.js version 14.x or higher and a compatible Rust toolchain to build from source.
fix
Install Node.js 14+ and Rust. Use prebuilt binaries if available via package manager.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'sql-describe'
Package not installed or not built from source.
fix
Run 'npm install sql-describe' and ensure the native addon is built (npm run build) if using git clone.
TypeError: describe is not a function
Incorrect import; using CommonJS require or destructuring from default export.
fix
Use 'import { describe } from "sql-describe"' correctly.
SyntaxError: Unexpected token '?'
Using '?' placeholder in version 0.1.x which only supports '$1' style.
fix
Use '$1' placeholders or upgrade to version >=0.2.0 for '?' support.
Upgrade
Version history
0.1.13latest on npm
Audit
Dependencies
neonrequiredRust-Node.js bindings for native addon
Agent activity
16 hits · last 30 days
node
14
Meta
1
OpenAI (training)
1
Resources
sql-describe — npm install sql-describe · libregistry