7 个仓库
Overriding default code generation templates and injecting vendor extensions to tailor output.
Distinct from Code Generators: Distinct from Code Generators: focuses on customizing the generation process via templates and extensions, not just generating code from definitions.
Explore 7 awesome GitHub repositories matching data & databases · Template-Based Code Customizers. Refine with filters or upvote what's useful.
go-swagger is a toolkit for working with Swagger/OpenAPI 2.0 specifications in Go. It generates server, client, and CLI code from a specification document, and can also produce a specification by scanning annotated Go source code. The project includes a static validation engine that checks documents against the schema and project-specific rules, and a specification transformation pipeline that resolves, flattens, and merges documents. The toolkit generates both client and server code from the same specification, ensuring consistency in request and response handling. It also produces a command
Allows overriding default templates and injecting vendor extensions to customize generated code.
Mockery is a code generation tool that produces mock implementations from Go interfaces, designed to simplify unit testing by automating the creation of test doubles. It parses Go source files using abstract syntax tree analysis to extract interface method signatures, then generates complete mock struct types that implement those interfaces with configurable function fields for test injection. The tool distinguishes itself through its configuration and customization capabilities. Rather than embedding directives in source code annotations, Mockery reads generation settings from a YAML configu
Uses custom templates and template data to control the structure and behavior of generated mocks.
sqlboiler is a database-first ORM generator for Go that analyzes an existing database schema to produce strongly typed structures and query helpers. It functions as a schema-driven code generator, transforming database tables and relationships into executable Go source code. The project distinguishes itself through a type-safe query builder that uses chainable modifiers to construct SQL statements, eliminating the need for raw string concatenation. It utilizes customizable text templates to generate source code, allowing for the aliasing of schema entities and the creation of custom templates
Allows overriding base templates and applying column filters to control the structure of generated output.
gotests 是一个 Go 语言的静态分析工具和样板代码生成器,可从源代码自动创建结构化的测试套件。它作为一个表驱动(table-driven)的测试框架,处理函数和方法的类型解析,包括将泛型类型约束映射到具体的实现类型。 该工具集成了大语言模型,能够根据函数逻辑合成真实的输入值和边界情况。它使用模板驱动的生成系统,允许通过外部模板和参数自定义生成测试代码的结构和格式。 该项目提供了用于递归包扫描和目录树处理的命令行工具。它包含作用域控制机制,可以使用正则表达式和可见性修饰符来过滤函数选择。
Provides mechanisms to modify the structure and format of generated test code using custom templates.
xo 是一个用于从 SQL 数据库模式和查询生成类型安全的 Go 模型和查询执行代码的工具。它是一个多方言 SQL 工具,支持 PostgreSQL、MySQL、SQLite、Oracle 和 Microsoft SQL Server,以生成地道的源代码。 该项目使用基于模板的生成系统,允许通过可自定义的文本模板定义生成的数据库源代码的结构和逻辑。它还包括一个数据库模式可视化器,用于分析表关系和定义,以创建可视化图表和结构化文档。 该工具的功能涵盖自动化 SQL 代码生成和创建专门的数据库模型。它提供了将自定义 SQL 查询映射到 Go 函数以及生成模式脚本以记录数据库迁移的实用程序。
Supports the use of text templates to modify the structure and logic of generated code.
dbtpl 是一个数据库模型生成器和模式内省工具,可从 SQL 数据库模式生成类型安全的源代码和数据模型。它作为一个命令行工具,将 SQL 类型映射到 Go 结构体和执行函数,同时提供了一个基于模板的系统,用于创建自定义源代码和模式定义。 该工具支持多种数据库引擎,包括 PostgreSQL、MySQL、SQLite、Oracle 和 SQL Server。它的独特之处在于允许用户通过文本模板定义自定义输出格式,并能为 Django Web 框架生成兼容的模型定义。 其功能还包括生成用于数据库迁移和镜像的 SQL 脚本,以及以 JSON 或 YAML 格式导出模式表示。此外,它还可以生成 dot 文件以可视化数据库关系和结构图。
The tool allows defining custom output formats by authoring or modifying base templates to match specific organizational requirements.
TypeScript generator is a build tool that parses backend class structures and REST endpoints in Java to generate corresponding TypeScript types and client services. It functions as both a static type definition generator and a Java REST client generator, translating compiled class properties, collections, and server-side endpoint definitions into equivalent frontend type definitions and client-side service classes. The tool builds an abstract syntax representation from scanned bytecode using reflection and compiles output through configurable module scoping, formatting declarations into globa
Controls how generated code structures outputs into global definitions, ambient modules, or standard files with declarations.