Mingru (v0.63.0) is a pre-1.0 SQL generator for mingru-models that converts TypeScript model definitions into Go code with no runtime overhead. Unlike ORMs, mingru is a build-time SQL builder focusing on MySQL/MariaDB and Go. It supports TypeScript-defined schemas, actions like select/insert/update/delete, and generates both Go source files and CREATE TABLE SQL. The package is in active development with APIs subject to change. It requires Node >=16.7.0 and is designed to be used alongside mingru-models and mingru-tsconfig.
npm install mingruNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a User table model and actions using mingru-models, then generates Go and SQL files.
Pin exact version in package.json and test upgrades thoroughly.
Refer to source code or GitHub issues for latest usage patterns.
Use ES modules (import syntax) or ensure bundler/transpiler supports ESM.
Install Go and configure build pipeline accordingly.
Keep mingru and mingru-models versions compatible (major.minor).
Run: yarn add mingru-tsconfig -D
Use import syntax: import { Builder } from 'mingru'Create a dialect instance first: new mr.MySQL()