Help us shape the future of Go! Take the 2026 Go Developer Survey

render

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsWritableColumn

func IsWritableColumn(column manifest.Column) bool

func Render

func Render(ctx context.Context, m *manifest.Manifest, outputFolder string, config Config) error

func Validate

func Validate(m *manifest.Manifest) error

Types

type Column

type Column struct {
	ColumnName     string
	IsUUID         bool
	IsUUIDString   bool
	IsBinaryBytes  bool
	GoName         string
	JSONName       string
	IncludeJSONTag bool
	ResolvedGoType string
	ScanKind       string
	IsJSON         bool
	IsUnsigned     bool
}

type Config

type Config struct {
	Dialect              string
	TemplateFS           fs.FS
	TemplateName         string
	SQLIdentifier        func(string) string
	SQLTableIdentifier   func(catalog, schema, name string) string
	Placeholder          func(index int) string
	InsertStrategy       InsertStrategy
	EmptyInsert          string
	UnsignedLastInsertID bool
	RejectNullUpdateKey  bool
	TypeDefaults         map[string]manifest.TypeMapping
	ScanSQLServerUUID    bool
	TypedBinaryNulls     bool
	ScanBinary           bool
}

type Data

type Data struct {
	Table                Table
	IdentityColumns      []Column
	Imports              []Import
	InsertStrategy       InsertStrategy
	EmptyInsert          string
	Names                map[string]string
	ScanJSON             bool
	ScanBoolean          bool
	ScanTime             bool
	ScanUUID             bool
	ScanSQLServerUUID    bool
	UUIDArguments        bool
	JSONArguments        bool
	BinaryArguments      bool
	ScanBinary           bool
	UnsignedLastInsertID bool
	RejectNullUpdateKey  bool
}

func BuildData

func BuildData(m *manifest.Manifest, table manifest.Table) (Data, error)

type Import added in v0.2.0

type Import struct {
	Qualifier string
	Path      string
}

type InsertStrategy added in v0.2.0

type InsertStrategy string
const (
	InsertExecLastInsertID InsertStrategy = "last-insert-id"
	InsertQueryReturning   InsertStrategy = "returning"
	InsertScopeIdentity    InsertStrategy = "scope-identity"
)

type Table

type Table struct {
	TableCatalog  string
	TableSchema   string
	TableName     string
	TableType     string
	FileName      string
	PackageName   string
	GoName        string
	Columns       []Column
	WriteColumns  []Column
	UpdateColumns []Column
	KeyColumns    []Column
}

Directories

Path Synopsis
Package query composes SQL fragments and binds named values for its generated dialect.
Package query composes SQL fragments and binds named values for its generated dialect.

Jump to

Keyboard shortcuts

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