Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 1.89 KB

README.md

File metadata and controls

73 lines (53 loc) · 1.89 KB

Welcome to ddl2struct 👋

Version License

Create golang struct from ddl

Install

go get github.com/realsangil/ddl2struct

Usage

ddl2struct [flags]

Flags

-c, --copy            copy to clipboard
-h, --help            help for ddl2struct
-i, --input string    sql file path
-o, --output string   output file path

Example

ddl2struct -i example.sql

Result

#   ____ ____ __      ____ __     ____ ____ ____ _  _  ___ ____ 
#  (    (    (  )    (_  _/  \   / ___(_  _(  _ / )( \/ __(_  _)
#   ) D () D / (_/\    )((  O )  \___ \ )(  )   ) \/ ( (__  )(  
#  (____(____\____/   (__)\__/   (____/(__)(__\_\____/\___)(__)

===============================================================
TableName: ddl2struct
ColumnCount: 5
Save your times: About 10 seconds
===============================================================

type ddl2struct struct {
        Personid  int    `json:"personid" gorm:"Column:personid"`
        Lastname  string `json:"lastname" gorm:"Column:lastname"`
        Firstname string `json:"firstname" gorm:"Column:firstname"`
        Address   string `json:"address" gorm:"Column:address"`
        City      string `json:"city" gorm:"Column:city"`
}

Author

👤 realsangil

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 realsangil.

This project is Apache License 2.0 licensed.


This README was generated with ❤️ by readme-md-generator