A CLI tool that generates TypeScript type definitions and typed query functions from SQL schemas and queries, supporting PostgreSQL and MySQL. At version 0.10.1, it's in early development with an oclif-based CLI. Key differentiators: generates both types and executable query functions, works with existing .sql files and .ts files containing SQL strings, and uses a single config file (codegen.sql.yml). Requires peer dependency yesql 3.2.2. Inspired by graphql-code-generator.
npm install sql-code-generatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installation, config setup, and running the generator to produce TypeScript types and query functions from SQL schemas.
Pin to exact version in package.json.
Install yesql as a dependency: npm install yesql@3.2.2
Ensure file exists at project root or use --config <path>
Run: npm install yesql@3.2.2
Create codegen.sql.yml in the project root or specify with --config.