sql 语句转成 ent schema

sql2ent

该项目提供 sql 语句转化为 entgo schema 代码的命令行工具, 以提高工作效率。

前往学习entgo

功能

已完成

  1. 使用命令行批量转化
  2. 支持 mysql

计划

  1. 支持更多的数据库,例如:MariaDB、SQLite、PostgreSQL。
  2. 读取数据库,批量生成 schema 文件。
  3. 等等...

快速开始

第一步:安装 sql2ent

go get -u github.com/miaogaolin/sql2ent

第二步:运行命令

sql2ent mysql ddl -src "./sql/*.sql" -dir "./ent/schema"

说明:

  • -src: 输入 sql 路径,可模糊匹配
  • -dir: 输出目录,默认 ./ent/schema

参与开源

  1. 点击 Fork
  2. 提交自己的代码到 Fork 的仓库中
  3. Pull Request 将自己的代码合并

联系我

Similar Resources

Schema - JSON Schema rules plugin

This plugin allows to configure JSON Schema validations rules ensuring user-submitted records adhere to a pre-defined data schema.

Feb 16, 2022

entimport is a tool for creating Ent schemas from existing SQL databases.

entimport entimport is a tool for creating Ent schemas from existing SQL databases. Currently, MySQL and PostgreSQL are supported. The tool can import

Dec 23, 2022

sqlcomment is an ent driver that adds SQL comments following sqlcommenter specification.

sqlcomment sqlcomment is an ent driver that adds SQL comments following sqlcommenter specification. sqlcomment includes support for OpenTelemetry and

Nov 14, 2022

SQL schema migration tool for Go.

sql-migrate SQL Schema migration tool for Go. Based on gorp and goose. Using modl? Check out modl-migrate. Features Usable as a CLI tool or as a libra

Jan 2, 2023

Go library that stores data in Redis with SQL-like schema

Go library that stores data in Redis with SQL-like schema. The goal of this library is we can store data in Redis with table form.

Mar 14, 2022

Ent adapter for Casbin

Ent-Adapter Ent Adapter is the ent adapter for Casbin. With this library, Casbin can load policy from PostgresSQL/Mysql or save policy to it. Installa

Dec 20, 2022

entcache - An experimental cache driver for ent with variety of storage options

 entcache - An experimental cache driver for ent with variety of storage options

entcache An experimental cache driver for ent with variety of storage options, such as: A context.Context-based cache. Usually, attached to an HTTP re

Dec 28, 2022

🛠 A test fixtures replacement for Go, support struct and ent, inspired by factory_bot/factory_boy

carrier - A Test Fixtures Replacement for Go Statically Typed - 100% statically typed using code generation Developer Friendly API - explicit API with

Jan 23, 2022

This is a sample application of golang's web framework gin and orm ent.

Gin Ent Sample This is a sample application of golang's web framework gin and orm ent. Components Web Framework: Gin ORM: ent SQL Migration tool: goos

Dec 5, 2021

Combine ent and gRPC, using Postgres as DBMS

database-system Combine ent and gRPC, using Postgres as DBMS How to develop Install tools brew install protobuf go mod tidy go install google.golang

Jan 9, 2022

It took me a while to figure out how I can use GraphQL with the ent ORM and serve the GraphQL endpoint via the Echo framework

Go + Graphql + Ent + Echo Boilerplate It took me a while to figure out how I can use GraphQL with the ent ORM and serve the GraphQL endpoint via the E

Sep 28, 2022

Enthstore - Hstore type and predicates for Ent

Hstore type and predicates for Ent. This package defines the Postgres hstore typ

Sep 27, 2022

Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server

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 intro

Jan 8, 2023

Go tool for generating sql scanners, sql statements and other helper functions

sqlgen generates SQL statements and database helper functions from your Go structs. It can be used in place of a simple ORM or hand-written SQL. See t

Nov 24, 2022

A logger for Go SQL database driver without modify existing *sql.DB stdlib usage.

A logger for Go SQL database driver without modify existing *sql.DB stdlib usage.

SQLDB-Logger A logger for Go SQL database driver without modify existing *sql.DB stdlib usage. Colored console writer output above only for sample/dev

Jan 3, 2023

Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side ("transparent") encryption. SQL, NoSQL.

Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side (

Database protection suite with field level encryption and intrusion detection. | Acra Engineering Examples | Documentation | Installation | Examples a

Dec 28, 2022

write APIs using direct SQL queries with no hassle, let's rethink about SQL

SQLer SQL-er is a tiny portable server enables you to write APIs using SQL query to be executed when anyone hits it, also it enables you to define val

Jan 7, 2023

Go fearless SQL. Sqlvet performs static analysis on raw SQL queries in your Go code base.

Sqlvet Sqlvet performs static analysis on raw SQL queries in your Go code base to surface potential runtime errors at build time. Feature highlights:

Dec 19, 2022

"Go SQL DB" is a relational database that supports SQL queries for research purposes

A pure golang SQL database for database theory research

Jan 6, 2023
Related tags
This is a sample application of golang's web framework gin and orm ent.

Gin Ent Sample This is a sample application of golang's web framework gin and orm ent. Components Web Framework: Gin ORM: ent SQL Migration tool: goos

Dec 5, 2021
Combine ent and gRPC, using Postgres as DBMS

database-system Combine ent and gRPC, using Postgres as DBMS How to develop Install tools brew install protobuf go mod tidy go install google.golang

Jan 9, 2022
Enthstore - Hstore type and predicates for Ent

Hstore type and predicates for Ent. This package defines the Postgres hstore typ

Sep 27, 2022
Generate Terraform schema from Go structs

terraform-schema-gen This repository contains a CLI to generate Terraform schema out of Go structs. The generator relies on kube-openapi as an interme

Sep 13, 2022
Demo of schema change failures with SQLite INTEGERs.

SQLite Schema Migration Bug This is a repository to reproduce a bug with Ent and the modernc.org/sqlite (non-CGO) SQLite 3 driver. Reproduce Simply ru

Dec 9, 2021
Schematic - Generates model and validators by schema definition

schematic Generates model and validators by schema definition. Install Warning:

Feb 10, 2022
kubequery is a Osquery extension that provides SQL based analytics for Kubernetes clusters

kubequery powered by Osquery kubequery is a Osquery extension that provides SQL based analytics for Kubernetes clusters kubequery will be packaged as

Dec 27, 2022
A CLI for generating ER diagrams for Ent schema
A CLI for generating ER diagrams for Ent schema

enter A CLI for generating ER (entity-relationship) diagrams for Ent schema using mermaid.js.

Dec 18, 2022
entviz is an ent extension that provides visualization of the schema graph
entviz is an ent extension that provides visualization of the schema graph

entviz entviz is an ent extension that creates visual graph (html file) of your ent's schema. install go get github.com/hedwigz/entviz add this exten

Dec 9, 2022
A tool to compare if terraform provider migration schema snapshot is equal to schema defined in resource code

migration schema comparer for Terraform When develop Terraform provider sometimes we need do some state migration(not schema migration) via StateUpgra

Nov 18, 2021