xo

支持 PostgreSQL、MySQL、SQLite、Oracle 和 Microsoft SQL Server 的命令行工具,为 SQL 数据库生成惯用的 Go 代码。「Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server」

Github stars Tracking Chart

About xo

xo is a command-line tool to generate Go
code based on a database schema or a custom query.

xo works by using database metadata and SQL introspection queries to discover
the types and relationships contained within a schema, and applying a standard
set of base (or customized) Go templates against the discovered relationships.

Currently, xo can generate types for tables, enums, stored procedures, and
custom SQL queries for PostgreSQL, MySQL, Oracle, Microsoft SQL Server, and
SQLite3 databases.

NOTE: While the code generated by xo is production quality, it is not the
goal, nor the intention for xo to be a "silver bullet," nor to completely
eliminate the manual authoring of SQL / Go code.

Database Feature Support

The following is a matrix of the feature support for each database:

Main metrics

Overview
Name With Ownerxo/dbtpl
Primary LanguageGo
Program languageGo (Language Count: 7)
PlatformLinux, Mac, Windows
License:MIT License
所有者活动
Created At2016-02-05 10:22:20
Pushed At2025-06-23 21:32:48
Last Commit At2025-06-24 04:32:22
Release Count4
Last Release Namev1.1.0 (Posted on )
First Release Namev1.0.0 (Posted on )
用户参与
Stargazers Count3.9k
Watchers Count67
Fork Count330
Commits Count435
Has Issues Enabled
Issues Count264
Issue Open Count48
Pull Requests Count53
Pull Requests Open Count6
Pull Requests Close Count100
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private