core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(s string) string

func Offset

func Offset(v int) int

Types

type Config

type Config struct {
	Package                     string   `json:"package"`
	EmitExactTableNames         bool     `json:"emit_exact_table_names"`
	EmitClasses                 bool     `json:"emit_classes"`
	InflectionExcludeTableNames []string `json:"inflection_exclude_table_names"`
}

func MakeConfig

func MakeConfig(req *plugin.Request) (Config, error)

func (Config) MarshalEasyJSON

func (v Config) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Config) MarshalJSON

func (v Config) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Config) UnmarshalEasyJSON

func (v *Config) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Config) UnmarshalJSON

func (v *Config) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Constant

type Constant struct {
	Name  string
	Type  string
	Value string
}

type Enum

type Enum struct {
	Name      string
	Comment   string
	Constants []Constant
}

func BuildEnums

func BuildEnums(req *plugin.CodeGenRequest) []Enum

type Field

type Field struct {
	ID      int
	Name    string
	Type    fsType
	Comment string
}

type QueryValue

type QueryValue struct {
	Emit   bool
	Name   string
	Struct *Struct
	Typ    fsType
}

func (QueryValue) EmitStruct

func (v QueryValue) EmitStruct() bool

func (QueryValue) IsStruct

func (v QueryValue) IsStruct() bool

func (QueryValue) Type

func (v QueryValue) Type() string

type Struct

type Struct struct {
	Table   plugin.Identifier
	Name    string
	Fields  []Field
	Comment string
}

func BuildDataClasses

func BuildDataClasses(conf Config, req *plugin.CodeGenRequest) []Struct

type TmplCtx

type TmplCtx struct {
	Q           string
	Package     string
	Enums       []Enum
	DataClasses []Struct
	Settings    *plugin.Settings
	SqlcVersion string
	// TODO: Race conditions
	SourceName string

	Configuration       Config
	EmitJSONTags        bool
	EmitPreparedQueries bool
	EmitInterface       bool
}

Jump to

Keyboard shortcuts

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