ddltogo

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ddltogo A util can help to generate go struct by Create SQL DDL. Input: create sql; Output: golang struct.

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Debug level logging

Functions

func DdlToGo

func DdlToGo(sql string) ([]byte, error)

DdlToGo uses create sql to generate golang struct with gorm tags.

func Generate

func Generate(columnTypes []map[string]string, tableName string, structName string, pkgName string, jsonAnnotation bool, gormAnnotation bool, gureguTypes bool) ([]byte, error)

Generate Given a Column map with datatypes and a name structName, attempts to generate a struct definition

func GetColumnsFromMysqlTable

func GetColumnsFromMysqlTable(mariadbUser string, mariadbPassword string, mariadbHost string, mariadbPort int, mariadbDatabase string, mariadbTable string) (*map[string]map[string]string, error)

GetColumnsFromMysqlTable Select column details from information schema and return map of map

Types

This section is empty.

Jump to

Keyboard shortcuts

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