CLI tool that generates TypeScript types from annotated MySQL SQL files. v1.0.0. Designed for teams wanting raw SQL with type safety without an ORM. Generates typed interfaces for query results and parameters, SQL constants, and optional execution helpers. MySQL-focused, uses Handlebars templates, supports watch mode. Compared to alternatives like pgtyped or sql-ts, provides explicit annotation-based configuration and built-in mysql2 integration.
npm install tiposaurus-rexNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Setup, generate types from annotated SQL, and execute a typed query using mysql2/promise with named placeholders.
Add tiposaurus.config.json to .gitignore, use environment variables or CI secrets.
Ensure mysql2 connection options include { namedPlaceholders: true } or use raw SQL constants without helpers.Ensure SQL files have properly formatted annotations with @name and @param keywords.
Use only with MySQL databases. For other databases, consider alternatives like pgtyped.
Restart watch mode manually if changes are not detected, or check file system permissions.
Run 'npm install -D tiposaurus-rex' first, then use 'npx tiposaurus generate'.
Check tiposaurus.config.json db settings, start MySQL server, verify credentials.
Run 'npx tiposaurus generate' to produce files, and verify outputDir in config matches the import path.
Import from 'mysql2/promise' instead of 'mysql2'.