Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inherd/sqling
build domain model from MySQL schema
https://github.com/inherd/sqling
domain-driven-design domain-specific-language
Last synced: 7 days ago
JSON representation
build domain model from MySQL schema
- Host: GitHub
- URL: https://github.com/inherd/sqling
- Owner: modernizing
- License: mit
- Created: 2021-06-10T15:39:38.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-06-28T01:41:13.000Z (over 3 years ago)
- Last Synced: 2024-04-10T04:51:19.173Z (10 months ago)
- Topics: domain-driven-design, domain-specific-language
- Language: Go
- Homepage:
- Size: 254 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-modernization - SQLing
README
# SQLing
> build domain model from SQL file
## Usage
1. download sqling from [release](https://github.com/inherd/sqling/releases) or
```bash
go get github.com/inherd/sqling
```2. dump sql file
```bash
mysqldump -u root -p -h localhost --no-data mall > database.sql
```3. run `sqling -i database.sql`
### CLI Usage
CLI
```bash
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:
- [x] import sql parser
- [x] use cobra as cli tools
- [x] output
- [x] json
- [x] pumlPlan:
- [ ] analysis
- [ ] [xo](https://github.com/xo/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
- https://github.com/rory/django-sql-inspectorThinks:
- [ ] 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:
- [MysqlParser](https://github.com/mysql/mysql-server/blob/8.0/sql/sql_yacc.yy)
- [Pingcap Parser BNF](https://github.com/pingcap/parser/blob/81106e4996bfdaaf5f0ef87ac8280d03b719594d/compatibility_reporter/mysql80_bnf.txt)Related projects:
- [SOAR](https://github.com/XiaoMi/soar) - 是一个对 SQL 进行优化和改写的自动化工具。
- [SQLFlow](https://github.com/sql-machine-learning/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.