A declarative relational database SQL schema generator for PostgreSQL that abstracts boilerplate and enforces best practices like insert-only temporal database design, optimal data types, and naming conventions. Current stable version is 0.25.2, with an inactive release cadence (last release in 2020). It generates static and versioned tables, mapping tables, upsert functions, and current-version views to support event-driven, domain-driven design patterns. Unlike ORMs or migration tools, it produces raw SQL files under user control, avoiding lock-in and allowing custom modifications.
npm install sql-schema-generatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generates SQL schema for a 'user' entity with static and updatable properties, outputting CREATE TABLE statements.
Update to v1.0.0+ and use the string directly.
Use quoted identifiers in SQL if case mixing is needed.
Rename reference columns to match the naming convention.
Define a separate mapping table entity instead of array properties.
Use `import { generateSchema } from 'sql-schema-generator';`Add type: 'string' (or appropriate type) to all properties.
Use double-quoted identifiers for reserved words like 'user'.