gotype

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbTOGoTypeTransformer

type DbTOGoTypeTransformer interface {
	ToGoType(col *plugin.Column) GoType
}

func NewDbTOGoTypeTransformer

func NewDbTOGoTypeTransformer(
	engine opts.SQLEngine,
	customTypes []sqltype.CustomType,
	options *opts.Options,
) (DbTOGoTypeTransformer, error)

type GoType

type GoType struct {
	// contains filtered or unexported fields
}

func NewGoType

func NewGoType(fullTypeName string) *GoType

NewGoType creates a new GoType from a full type name e.g. plugin.Table -> GoType{typeName: "Table", packageName: "plugin"} e.g. *plugin.Table -> GoType{typeName: "Table", packageName: "plugin", isPointer: true} e.g. []plugin.Table -> GoType{typeName: "Table", packageName: "plugin", isArray: true, arrayDims: 1} e.g. github.com/sqlc-dev/plugin-sdk-go/plugin.Table -> GoType{typeName: "Table", packageName: "plugin", typeImport: Import{Path: "github.com/sqlc-dev/plugin-sdk-go/plugin"}}

func (*GoType) Import

func (g *GoType) Import() imports.Import

func (*GoType) IsArray

func (g *GoType) IsArray() bool

func (*GoType) IsPointer

func (g *GoType) IsPointer() bool

func (*GoType) PackageName

func (g *GoType) PackageName() string

func (*GoType) SetImport

func (g *GoType) SetImport(imp imports.Import) *GoType

func (*GoType) String

func (g *GoType) String() string

func (*GoType) TypeName

func (g *GoType) TypeName() string

func (*GoType) TypeWithPackage

func (g *GoType) TypeWithPackage() string

type GoTypeFormatter

type GoTypeFormatter struct {
	// contains filtered or unexported fields
}

func NewGoTypeFormatter

func NewGoTypeFormatter(
	typeTransformer DbTOGoTypeTransformer,
	options *opts.Options,
) *GoTypeFormatter

func (*GoTypeFormatter) ToGoType

func (f *GoTypeFormatter) ToGoType(col *plugin.Column) GoType

type MysqlTypeTransformer

type MysqlTypeTransformer struct {
	// contains filtered or unexported fields
}

func NewMysqlTypeTransformer

func NewMysqlTypeTransformer(customTypes []sqltype.CustomType) *MysqlTypeTransformer

func (*MysqlTypeTransformer) ToGoType

func (t *MysqlTypeTransformer) ToGoType(col *plugin.Column) GoType

type PostgresqlTypeTransformer

type PostgresqlTypeTransformer struct {
	// contains filtered or unexported fields
}

func NewPostgresqlTypeTransformer

func NewPostgresqlTypeTransformer(options *opts.Options, customTypes []sqltype.CustomType) *PostgresqlTypeTransformer

func (*PostgresqlTypeTransformer) ToGoType

func (t *PostgresqlTypeTransformer) ToGoType(col *plugin.Column) GoType

type SqlLiteTypeTransformer

type SqlLiteTypeTransformer struct {
	// contains filtered or unexported fields
}

func NewSqlLiteTypeTransformer

func NewSqlLiteTypeTransformer(options *opts.Options, customTypes []sqltype.CustomType) *SqlLiteTypeTransformer

func (*SqlLiteTypeTransformer) ToGoType

func (t *SqlLiteTypeTransformer) ToGoType(col *plugin.Column) GoType

Jump to

Keyboard shortcuts

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