Skip to content

psi59/ddl2struct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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