Converts informal SQL SELECT statements (e.g., "SELECT 'food name', 'calcium' FROM 'apples'") into formal SQL (e.g., "SELECT 'name', 'ca', 'ca_e' FROM 'compositions' WHERE ...") via a user-supplied mapping function. Version 0.2.6, low release cadence. Key differentiator: decouples user-facing informal queries from actual schema by delegating mapping to an external callback, enabling dynamic column/table resolution against a database or dictionary.
npm install pg-slangNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts informal SELECT with column mapping and table-based WHERE clause.
Ensure map function returns an array, e.g., return ['expression'].
Always return at least one expression per column, or handle gracefully.
Check type === 'from' or type === 'table' (whichever is documented) to identify table names.
Use const slang = require('pg-slang'); (no destructuring) or import slang from 'pg-slang'Use `const slang = require('pg-slang');`Return an array, e.g., `return ['expression'];`
Ensure slang is the function returned by `require('pg-slang')` or default importNo dependency data recorded yet.