pqtgo

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeDefault = iota
	ModeMandatory
	ModeOptional
	ModeCriteria
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltinType

type BuiltinType types.BasicKind

BuiltinType ...

func (BuiltinType) Fingerprint

func (bt BuiltinType) Fingerprint() string

Fingerprint implements Type interface.

func (BuiltinType) String

func (bt BuiltinType) String() string

type Component added in v0.21.0

type Component uint64
const (
	ComponentInsert Component = 1 << (64 - 1 - iota)
	ComponentFind
	ComponentUpdate
	ComponentUpsert
	ComponentCount
	ComponentDelete
	ComponentHelpers

	ComponentRepository = ComponentInsert | ComponentFind | ComponentUpdate | ComponentUpsert | ComponentCount | ComponentDelete
	ComponentAll        = ComponentRepository | ComponentHelpers
)

type CustomType

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

CustomType ...

func TypeCustom

func TypeCustom(m, o, c interface{}) CustomType

TypeCustom ...

func (CustomType) Fingerprint

func (ct CustomType) Fingerprint() string

Fingerprint implements Type interface.

func (CustomType) String

func (ct CustomType) String() string

String implements Stringer interface.

func (CustomType) TypeOf added in v0.11.0

func (ct CustomType) TypeOf(m int32) reflect.Type

TypeOf ...

func (CustomType) ValueOf added in v0.11.0

func (ct CustomType) ValueOf(m int32) interface{}

ValueOf ...

type Formatter added in v0.11.0

type Formatter struct {
	Visibility Visibility
	Acronyms   map[string]string
}

func (*Formatter) Identifier added in v0.11.0

func (f *Formatter) Identifier(args ...string) (r string)

func (*Formatter) IdentifierPrivate added in v0.11.0

func (f *Formatter) IdentifierPrivate(args ...string) (r string)

func (*Formatter) Type added in v0.11.0

func (f *Formatter) Type(t pqt.Type, m int32) string

type Generator

type Generator struct {
	Formatter  *Formatter
	Version    float64
	Pkg        string
	Imports    []string
	Plugins    []Plugin
	Components Component
}

func (*Generator) Generate

func (g *Generator) Generate(s *pqt.Schema) ([]byte, error)

Generate ...

func (*Generator) GenerateTo

func (g *Generator) GenerateTo(w io.Writer, s *pqt.Schema) error

GenerateTo ...

type Plugin added in v0.11.0

type Plugin interface {
	PropertyType(*pqt.Column, int32) string
	WhereClause(*pqt.Column) string
	// SetClause allow to generate alternative code for column for update queries.
	// Available placeholders:
	//
	// 	{{ .selector }} - property of patch object
	// 	{{ .column }} - const that represents given column
	// 	{{ .composer }} - Composer instance
	SetClause(*pqt.Column) string
	ScanClause(*pqt.Column) string
	Static(*pqt.Schema) string
}

type Visibility added in v0.6.0

type Visibility string

Visibility ...

const (
	// Public ...
	Public Visibility = "public"
	// Private ...
	Private Visibility = "private"
)

Jump to

Keyboard shortcuts

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