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 gesundheitNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows building a SELECT statement with where conditions, compiling to SQL with bound parameters, and optional execution.
Consider using a maintained library like knex or squel for SQL generation.
Replace any-db with a modern database driver (e.g., pg, mysql2) and use query compilation only, not execution via any-db.
If using PostgreSQL which uses $1, match the placeholder style manually or use a different library.
Refer to source code or README for API usage; avoid relying on external docs.
Install any-db: npm install any-db
Use require: const { select } = require('gesundheit');Only require the main package: require('gesundheit'), and destructure needed exports.