ddl2struct

command module
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

Welcome to ddl2struct 👋

Version License

Create golang struct from ddl

Install

go get github.com/Sterrenhemel/ddl2struct

Usage

ddl2struct [flags]
Flags
-h, --help            help for ddl2struct
-i, --input string    sql file path
-o, --output string   output file path
-p, --package string  golang file package
Example
ddl2struct -i example.sql -o tests -p tests
Result
// Code generated by DDL2STRUCT. DO NOT EDIT.
// InputFile: tests/example.sql
package tests

type Ddl2Struct struct {
        PersonId  int    `json:"person_id" gorm:"column:person_id"`
        LastName  string `json:"last_name" gorm:"column:last_name"`
        FirstName string `json:"first_name" gorm:"column:first_name"`
        Address   string `json:"address" gorm:"column:address"`
        City      string `json:"city" gorm:"column:city"`
}

type Ddl2Struct2 struct {
        PersonId  int    `json:"person_id" gorm:"column:person_id"`
        LastName  string `json:"last_name" gorm:"column:last_name"`
        FirstName string `json:"first_name" gorm:"column:first_name"`
        Address   string `json:"address" gorm:"column:address"`
        City      string `json:"city" gorm:"column:city"`
}

Documentation

Overview

Copyright © 2020 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL