Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKotlinNoOutPath = errors.New("no output path")
View Source
var ErrMissingEngine = errors.New("unknown engine")
View Source
var ErrMissingVersion = errors.New("no version number")
View Source
var ErrNoPackageName = errors.New("missing package name")
View Source
var ErrNoPackagePath = errors.New("missing package path")
View Source
var ErrNoPackages = errors.New("no packages")
View Source
var ErrUnknownEngine = errors.New("invalid engine")
View Source
var ErrUnknownVersion = errors.New("invalid version number")
Functions ¶
This section is empty.
Types ¶
type CombinedSettings ¶
type CombinedSettings struct {
Global Config
Package SQL
Go SQLGo
Kotlin SQLKotlin
Rename map[string]string
Overrides []Override
}
func Combine ¶
func Combine(conf Config, pkg SQL) CombinedSettings
type Config ¶
type Override ¶
type Override struct {
// name of the golang type to use, e.g. `github.com/segmentio/ksuid.KSUID`
GoType string `json:"go_type" yaml:"go_type"`
// fully qualified name of the Go type, e.g. `github.com/segmentio/ksuid.KSUID`
DBType string `json:"db_type" yaml:"db_type"`
Deprecated_PostgresType string `json:"postgres_type" yaml:"postgres_type"`
// for global overrides only when two different engines are in use
Engine Engine `json:"engine,omitempty" yaml:"engine"`
// True if the GoType should override if the maching postgres type is nullable
Null bool `json:"null" yaml:"null"`
// fully qualified name of the column, e.g. `accounts.id`
Column string `json:"column" yaml:"column"`
ColumnName string
Table pg.FQN
GoTypeName string
GoPackage string
GoBasicType bool
}
type SQLGo ¶
type SQLGo struct {
EmitInterface bool `json:"emit_interface" yaml:"emit_interface"`
EmitJSONTags bool `json:"emit_json_tags" yaml:"emit_json_tags"`
EmitPreparedQueries bool `json:"emit_prepared_queries" yaml:"emit_prepared_queries":`
Package string `json:"package" yaml:"package"`
Out string `json:"out" yaml:"out"`
Overrides []Override `json:"overrides,omitempty" yaml:"overrides"`
Rename map[string]string `json:"rename,omitempty" yaml:"rename"`
}
type V1GenerateSettings ¶
type V1GenerateSettings struct {
Version string `json:"version" yaml:"version"`
Packages []v1PackageSettings `json:"packages" yaml:"packages"`
Overrides []Override `json:"overrides,omitempty" yaml:"overrides,omitempty"`
Rename map[string]string `json:"rename,omitempty" yaml:"rename,omitempty"`
}
func (*V1GenerateSettings) Translate ¶
func (c *V1GenerateSettings) Translate() Config
func (*V1GenerateSettings) ValidateGlobalOverrides ¶
func (c *V1GenerateSettings) ValidateGlobalOverrides() error
Click to show internal directories.
Click to hide internal directories.