parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCreateTableFromDB

func GetCreateTableFromDB(dsn, tableName string) (string, error)

func ParseSqlToWrite

func ParseSqlToWrite(sql string, writer io.Writer, options ...Option) error

Types

type ModelCodes

type ModelCodes struct {
	Package    string
	ImportPath []string
	StructCode []string
}

func ParseSql

func ParseSql(sql string, options ...Option) (ModelCodes, error)

func ParseSqlFromDB

func ParseSqlFromDB(dsn, tableName string, options ...Option) (ModelCodes, error)

type NullStyle

type NullStyle int
const (
	NullDisable NullStyle = iota
	NullInSql
	NullInPointer
)

type Option

type Option func(*options)

func WithCharset

func WithCharset(charset string) Option

func WithCollation

func WithCollation(collation string) Option

func WithColumnPrefix

func WithColumnPrefix(p string) Option

func WithForceTableName

func WithForceTableName() Option

func WithGormType

func WithGormType() Option

WithGormType will write type in gorm tag

func WithJsonTag

func WithJsonTag() Option

func WithNoNullType

func WithNoNullType() Option

func WithNullStyle

func WithNullStyle(s NullStyle) Option

func WithPackage

func WithPackage(pkg string) Option

func WithTablePrefix

func WithTablePrefix(p string) Option

Jump to

Keyboard shortcuts

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