SQG (SQL Query Generator)

•
38
•

Generates type-safe TypeScript, Java, and Python database access code from annotated SQL files.

SQG is a SQL-first code generation tool that bridges the gap between raw SQL and strongly-typed application code. By introspecting queries against live database engines like SQLite, DuckDB, or PostgreSQL at build time, SQG automatically determines column types and emits production-ready typed wrapper functions. This eliminates the need for manual type definitions or 'any' types, allowing developers to write native SQL while enjoying the full benefits of type safety and IDE autocompletion across multiple programming languages.

주요 기능

01Real-time database introspection for precise column type detection
02Support for better-sqlite3, DuckDB Node API, JDBC, and psycopg
03Comprehensive schema migration management using -- MIGRATE annotations
04High-performance DuckDB bulk appenders for rapid data ingestion
0538 GitHub stars
06Automatic type-safe code generation for TypeScript, Java, and Python

사용 사례

01Developing high-performance data pipelines with typed bulk-insert capabilities
02Creating typed database wrappers for SQLite, DuckDB, or PostgreSQL projects
03Managing schema migrations and SQL queries in a single source of truth