db2struct

package
v0.0.0-...-2bd70a3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(dsn, pkgName, output, tag string, skipComment bool)

Types

type Column

type Column struct {
	Field   string         `db:"Field"`
	Type    string         `db:"Type"`
	Null    string         `db:"Null"`
	Key     string         `db:"Key"`
	Default sql.NullString `db:"Default"`
	Extra   string         `db:"Extra"`
	Comment string         `db:"Comment"`
	Tag     template.HTML
}

type Index

type Index struct {
	KeyName    string `db:"Key_name"`
	ColumnName string `db:"Column_name"`
	NonUnique  uint8  `db:"Non_unique"`
}

type Table

type Table struct {
	Name    string `db:"TABLE_NAME"`
	Comment string `db:"TABLE_COMMENT"`
	Columns []Column
	Indexes map[string][]Index
}

type TemplateData

type TemplateData struct {
	PkgName string
	Tables  []Table
}

Jump to

Keyboard shortcuts

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