Documentation ¶
Index ¶
Constants ¶
const ( //Region defines catalog region (only for cloud database) Region = "Region" //Catalog defines catalog kind literal Catalog = "Catalog" //Schema defines schema kind literal Schema = "Schema" //Table defines table kind literal Table = "Table" //Index defines index kind literal Index = "Restriction" //View defines view kind literal View = "View" //Sequence defines sequence kind literal Sequence = "Sequence" //Function defines function kind literal Function = "Function" // SequenceNewCurrentValue defines kind literal SequenceNewCurrentValue = "SequenceNewCurrentValue" // Object defines kind literal Object = "Object" )
const ( //KindVersion defines information kind KindVersion = Kind(iota) //KindCatalogs defines catalogs kind KindCatalogs //KindCatalog defines catalog kind KindCatalog //KindCurrentSchema defines current schema kind KindCurrentSchema //KindSchemas defines schemas kind KindSchemas //KindSchema defines schema kind KindSchema //KindTables defines tabkes kind KindTables //KindTable defines table kind KindTable //KindViews defines views kind KindViews //KindView defines view kind KindView //KindPrimaryKeys defines primary keys kind KindPrimaryKeys //KindForeignKeys defines foreign key kind KindForeignKeys //KindConstraints defines constraints kind KindConstraints //KindIndexes defines indexes kind KindIndexes //KindIndex defines index kind KindIndex //KindSequences defines sequences kind KindSequences //KindFunctions defines functions kind KindFunctions //KindSession defines session kind KindSession //KindForeignKeysCheckOn defines fk check on kind KindForeignKeysCheckOn //KindForeignKeysCheckOff defines fk check off kind KindForeignKeysCheckOff // KindSequenceNextValue defines setting next value of sequence/autoincrement/identity kind KindSequenceNextValue // KindLockGet defines lock get kind KindLockGet // KindLockRelease defines lock release kind KindLockRelease //KindReserved defines reserved kind KindReserved )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Criterion ¶
Criterion represents query criterion
func NewCriterion ¶
NewCriterion creates a new criteria, name refers to kind.Crtiera, column to local vendor column, use '?' for already defined placeholder, %v for substitution
type DefaultHandler ¶
type DefaultHandler struct {
// contains filtered or unexported fields
}
DefaultHandler represents default handler, implements Handler interface
func NewHandler ¶
func NewHandler(fn func(ctx context.Context, db *sql.DB, target interface{}, options ...interface{}) (doNext bool, err error)) *DefaultHandler
NewHandler creates new DefaultHandler
func (*DefaultHandler) CanUse ¶
func (h *DefaultHandler) CanUse(options ...interface{}) bool
CanUse default implementation Handler's CanUse function
type Dialect ¶
type Dialect struct { database.Product Placeholder string // prepare statement placeholder, default '?', but oracle uses ':' PlaceholderResolver placeholder.Generator Transactional bool Insert dialect.InsertFeatures Upsert dialect.UpsertFeatures Load dialect.LoadFeature //LoadResolver temp.SessionResolver CanAutoincrement bool AutoincrementFunc string CanLastInsertID bool CanReturning bool //Postgress supports Returning Data From Modified Rows in one statement QuoteCharacter byte // TODO: check if column has a space or exist in keywords in this case use quote if keyword is specified // i.e. normalized column on the dialect Keywords map[string]bool DefaultPresetIDStrategy dialect.PresetIDStrategy SpecialKeywordEscapeQuote byte }
Dialect represents dialect
func (*Dialect) EnsurePlaceholders ¶
EnsurePlaceholders converts '?' to specific dialect placeholders if needed
func (*Dialect) PlaceholderGetter ¶
PlaceholderGetter returns PlaceholderResolver if not nil, otherwise returns function that returns Placeholder
type Handler ¶
type Handler interface { Handle(ctx context.Context, db *sql.DB, target interface{}, options ...interface{}) (doNext bool, err error) CanUse(options ...interface{}) bool }
Handler interface for handling pre- and post-query custom functions
type Kind ¶
type Kind int
Kind represents dictionary info kind
type Queries ¶
type Queries []*Query
Queries represents querties