Registry / database / gesundheit

gesundheit

JSON →
library0.10.0jsnpmunverified

Gesundheit is a SQL generation library for Node.js providing a sugary API to construct SQL statements using an abstract syntax tree approach. Current version is 0.10.0. It supports Postgres and MySQL via the Any-DB driver adapter, and can compile queries to strings with bound parameters or execute them directly against a database with streaming support. Unlike ORMs, it focuses on SQL generation without object mapping, and is inspired by SQLAlchemy and ARel. Development appears to be in maintenance mode with no recent updates.

npm install gesundheit
INSTALL
IMPORT
SIG · GESUNDHEIT
G
gesundheit
databasejavascriptv0.10.0
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.

select
const { select } = require('gesundheit');
import { select } from 'gesundheit';
Library is CJS-only; ESM imports will fail.
Statement
const { Statement } = require('gesundheit');
Export named Statement used internally; typically not used directly.
default import
const gesundheit = require('gesundheit');
import gesundheit from 'gesundheit';
No default export; namespace import or destructure from require.

Shows building a SELECT statement with where conditions, compiling to SQL with bound parameters, and optional execution.

const { select } = require('gesundheit'); // Build a select query const query = select('users', ['id', 'name']) .where({ status: 'active', age: { gt: 18 } }); // Compile to SQL and parameters const [sql, params] = query.compile(); console.log(sql); // SELECT users.id, users.name FROM users WHERE users.status = ? AND users.age > ? console.log(params); // ['active', 18] // Execute with any-db adapter (requires any-db driver) // query.execute(console.log);
Debug
Known issues
breakingThe package has no recent updates (last release 2017). Breaking changes may exist in peer dependency any-db and its drivers.
fix
Consider using a maintained library like knex or squel for SQL generation.
affects: >=0.1.0
deprecatedany-db peer dependency is deprecated and no longer maintained; many drivers are outdated for modern databases.
fix
Replace any-db with a modern database driver (e.g., pg, mysql2) and use query compilation only, not execution via any-db.
affects: >=0.1.0
gotchaThe compiled SQL uses '?' placeholders regardless of database type; only works with drivers that support '?'.
fix
If using PostgreSQL which uses $1, match the placeholder style manually or use a different library.
affects: *
gotchaDocumentation links are broken (point to GitHub pages domain that no longer exists).
fix
Refer to source code or README for API usage; avoid relying on external docs.
affects: *
Errors
Common errors & fixes
Cannot find module 'any-db'
Missing peer dependency any-db when trying to execute queries.
fix
Install any-db: npm install any-db
TypeError: entity is not a function
Attempting to import gesundheit via ES6 import syntax which is not supported.
fix
Use require: const { select } = require('gesundheit');
Error: Cannot find module 'gesundheit/...'
Trying to require a submodule path that does not exist.
fix
Only require the main package: require('gesundheit'), and destructure needed exports.
Upgrade
Version history
0.10.0latest on npm
Audit
Dependencies
any-dbrequiredPeer dependency; required for query execution and database interaction.
Agent activity
2 hits · last 30 days
node
2
Resources
gesundheit — npm install gesundheit · libregistry