generator

package
v0.0.0-...-b25413d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GoToSQL = map[string]string{
	"string":     "varchar(255)",
	"*string":    "varchar(255)",
	"int":        "int",
	"*int":       "int",
	"int64":      "bigint",
	"*int64":     "bigint",
	"float64":    "double",
	"*float64":   "double",
	"time.Time":  "datetime",
	"*time.Time": "datetime",
}
View Source
var SQLToGo = map[string]string{
	"varchar":      "string",
	"text":         "string",
	"varchar(255)": "string",
	"int":          "int",
	"bigint":       "int64",
	"double":       "float64",
	"decimal":      "float64",
	"float":        "float64",
	"datetime":     "time.Time",
	"date":         "time.Time",
}

Functions

func GenerateGoFromYAML

func GenerateGoFromYAML(data []byte, opts GoFromYAMLOptions) ([]byte, error)

func GenerateYAMLFromGo

func GenerateYAMLFromGo(opts YAMLFromGoOptions) ([]byte, error)

Types

type GoFromYAMLOptions

type GoFromYAMLOptions struct {
	Package string
	Table   string
}

type YAMLFromGoOptions

type YAMLFromGoOptions struct {
	Srcs     []string
	Merge    bool
	Existing []byte
}

Jump to

Keyboard shortcuts

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