/sqling

build domain model from MySQL schema

Primary LanguageGoMIT LicenseMIT

SQLing

build domain model from SQL file

Usage

  1. download sqling from release or
go get github.com/inherd/sqling
  1. dump sql file
mysqldump -u root -p -h localhost --no-data mall > database.sql
  1. run sqling -i database.sql

CLI Usage

CLI

Sqling is a modeling tool to build from SQL file.

Usage:
  sqling [flags]

Flags:
  -h, --help                 help for sqling
  -i, --input string         input file
  -t, --output_type string   output file type, support for puml, json (default "puml")

Todo

Todo:

  • import sql parser
  • use cobra as cli tools
  • output
    • json
    • puml

Plan:

  • analysis
    • xo Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server
  • web runtime
    • web assembly
  • bad smell

Thinks:

  • connect to database
    • search from: MySQL information_schema.KEY_COLUMN_USAGE
    • query select table_name from information_schema.tables where table_schema='csdb' and table_type='base table';

Refs:

Related projects:

  • SOAR - 是一个对 SQL 进行优化和改写的自动化工具。
  • SQLFlow is a compiler that compiles a SQL program to a workflow that runs on Kubernetes.

License

@ 2021 This code is distributed under the MIT license. See LICENSE in this directory.