Registry / database / postgres-dump-writer-helpers-220524-pmb

postgres-dump-writer-helpers-220524-pmb

JSON →
library0.3.3jsnpmunverified

Small utility library (v0.3.3, low release cadence) for Postgres SQL generation: provides quoteId and quoteVal functions for safely quoting identifiers and values. Minimal dependencies, MIT license. Differentiator: simple, focused, but lacks polish and documentation.

npm install postgres-dump-writer-helpers-220524-pmb
INSTALL
IMPORT
SIG · POSTGRES-DUMP-WRIT
P
postgres-dump-writer-helpers-220524-pmb
databasejavascriptv0.3.3
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.

default export
import helpers from 'postgres-dump-writer-helpers-220524-pmb'
const helpers = require('postgres-dump-writer-helpers-220524-pmb')
ESM-only package; CommonJS require will fail.
quoteId
import { quoteId } from 'postgres-dump-writer-helpers-220524-pmb'
import { quoteId } from 'postgres-dump-writer-helpers-220524-pmb/quoteId'
Named export from main module, not a subpath.
quoteVal
import { quoteVal } from 'postgres-dump-writer-helpers-220524-pmb'
import quoteVal from 'postgres-dump-writer-helpers-220524-pmb'
quoteVal is a named export, not default.

Demonstrates quoting a table name with space and a string with single quote.

import helpers from 'postgres-dump-writer-helpers-220524-pmb'; const id = 'my table'; const val = "O'Brien"; console.log(helpers.quoteId(id)); // "my table" with quotes as needed console.log(helpers.quoteVal(val)); // 'O''Brien'
Debug
Known issues
gotchaPackage name includes date and initials, may be unstable or experimental.
fix
Consider using more mature alternatives like 'pg-format' or 'sql-template-strings'.
affects: >=0.0.0
gotchaESM-only package; CommonJS require() will throw ERR_REQUIRE_ESM.
fix
Use dynamic import() or switch to ESM in your project.
affects: >=0.3.0
gotchaMinimal documentation; usage examples and API details are sparse.
fix
Review source code on GitHub to understand exact behavior.
affects: >=0.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using require() on an ESM-only package.
fix
Use import statement or dynamic import() instead of require().
Got unexpected output from quoteId
The function may not quote all necessary identifiers correctly.
fix
Check the source code for supported identifier characters.
No default export
Tried import helpers from '...' but module only has named exports.
fix
Use import { quoteId, quoteVal } from '...' or import * as helpers from '...'.
Upgrade
Version history
0.3.3latest on npm
Audit
Dependencies
postgres-dump-writer-helpers-220524-pmbrequiredSelf-referenced for the helper functions
Agent activity
4 hits · last 30 days
node
4
Resources