sql-to-go-struct-and-dao

Generate Go models and DAO CRUD code from MySQL CREATE TABLE statements.

6|2|Updated Feb 10, 2026
One-click install
npx skills add https://github.com/LingoJack/jcli --skill sql-to-go-struct-and-dao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-to-go-struct-and-dao
Source: https://github.com/LingoJack/jcli/tree/main/assets/skills/sql-to-go-struct-and-dao
Command: npx skills add https://github.com/LingoJack/jcli --skill sql-to-go-struct-and-dao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

This Skill eliminates the repetitive, error-prone work of manually writing Go models, query/DTO types, view VO types, and DAO CRUD code from existing MySQL CREATE TABLE statements.

Core Features & Use Cases

  • Generate full Go data access layers from SQL: Produces entity/PO, query DTO, view VO, and DAO CRUD code (with transactions and raw SQL) from your table schema.
  • Support itea-go and gorm frameworks: Lets you choose the generated DAO style for either itea-go (BaseDao) or pure gorm in a consistent workflow.
  • Schema-driven code consistency with DTO semantics: Applies conventions for DTO fields (Fuzzy/List/Start/End/OrderBy/Page) and the zero-value update semantics described in the references.

Quick Start

Tell the AI to generate Go code for your MySQL table by providing the CREATE TABLE SQL and configuring the output_path/package mapping under the .model_infrax directory for your project, then run jen to produce the model and DAO files.

Frequently Asked Questions about sql-to-go-struct-and-dao

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Go DAO and model code from MySQL CREATE TABLE statements?

To generate Go DAO code from MySQL CREATE TABLE statements, provide your SQL schema and configure the output_path and package mapping under the .model_infrax directory, then run jen to produce the model and DAO files.

Can I generate GORM DAO code or does it only support itea-go?

Yes, you can generate GORM DAO code. This Skill supports generating data access layers for both pure gorm and itea-go BaseDao styles, allowing you to choose your preferred framework within a consistent workflow.

What do I need to install to generate Go models from MySQL schema files?

You need to install model_infrax/jen to generate Go models. Before running the generator, you must initialize a .model_infrax directory containing your schema.sql and config.yml to correctly map the output path and package folder structure.

What is the best way to automate Go CRUD data access layer creation from an existing database?

The best way to automate Go CRUD data access layer creation is using a schema-driven code generation workflow. By feeding MySQL CREATE TABLE statements into the generator, you eliminate repetitive manual coding for models, DTOs, VOs, and DAOs.

Why do my generated Go models have zero-value update semantics and specific DTO field types?

Generated Go models have zero-value update semantics and specific DTO field types because the Skill automatically applies predefined conventions like Fuzzy, List, Start, and End to ensure consistent query behavior without hand-coding.