Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component uint64
Component bits represents single component that can be generated by the generator.
const ( // ComponentInsert represents Insert method of a repository. ComponentInsert Component = 1 << (64 - 1 - iota) // ComponentFind represents Find method of a repository. ComponentFind // ComponentUpdate represents Update method of a repository. ComponentUpdate // ComponentUpsert represents Upsert method of a repository. ComponentUpsert // ComponentCount represents Count method of a repository. ComponentCount // ComponentDelete represents Delete method of a repository. ComponentDelete // ComponentHelpers represents all helpers. ComponentHelpers // ComponentRepository is a bit mask that group all repository methods. ComponentRepository = ComponentInsert | ComponentFind | ComponentUpdate | ComponentUpsert | ComponentCount | ComponentDelete // ComponentAll is a bit mask that groups all components. ComponentAll = ComponentRepository | ComponentHelpers )
type Generator ¶
type Generator struct { // Version represents Postgres database version code will run against. Version float64 // Pkg is the name of package code is generated into. // By default it's "main". Pkg string // Imports allow to pass additional import paths that will be added into generated code. Imports []string // Plugins that generator will use during generation. Plugins []Plugin // Components ... Components Component // contains filtered or unexported fields }
Generator ...
type Plugin ¶
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 }
Click to show internal directories.
Click to hide internal directories.