Runtime database evolution engine for SQL systems (SQLite, PostgreSQL, MySQL) that lets you define schemas in code, reflect existing databases, and synchronize structure automatically. Version 1.2.6 (stable, active development) combines ORM-like schema definitions, automatic migration-less evolution, fluent SQL builder with joins/CTEs/window functions, and legacy DB inspection into one package. Unlike typical ORMs, it preserves full SQL control while handling schema changes safely. Ships TypeScript types and supports both ESM and CommonJS.
npm install sqlqueryhelperjsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a User entity with auto-incrementing id and non-null email, reflects it to synchronize the database, then queries all rows.
Use db.planReflect() to preview changes and set confirmDestructive: true in engine options to require explicit approval.
Define 'static entity = entity({...})' on every class passed to db.reflect().Replace 'class User extends Entity { ... }' with 'class User { static entity = entity({...}) }'Ensure you use the appropriate module system consistently: ESM with import and CJS with require.
Migrate from .output() to .returning() when using MySQL reflector.
Ensure class has a static entity property defined with entity({...}) and call db.reflect(YourClass).Add 'static entity = entity({...})' to the class definition.Set NODE_OPTIONS=--openssl-legacy-provider environment variable.