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.
The following is a matrix of the feature support for each database:
| PostgreSQL | MySQL | Oracle | Microsoft SQL Server | SQLite | |
|---|---|---|---|---|---|
| Models | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Primary Keys | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Foreign Keys | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Indexes | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Stored Procs | :white_check_mark: | :white_check_mark: | |||
| ENUM types | :white_check_mark: | :white_check_mark: | |||
| Custom types | :white_check_mark: |
Content type
Image
Digest
Size
5.8 MB
Last updated
over 8 years ago
docker pull sophos/xo