Documentation
¶
Overview ¶
This package exposes only the public types and functions for creating new modifiers for KSQL.
For understanding internal details of the code please read the `internal/modifiers` package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RegisterAttrModifier func(key string, modifier AttrModifier)
RegisterAttrModifier allow users to add custom modifiers on startup it is recommended to do this inside an init() function.
Functions ¶
This section is empty.
Types ¶
type AttrModifier ¶
type AttrModifier struct {
// The following attributes will tell KSQL to
// leave this attribute out of insertions, updates,
// and queries respectively.
SkipOnInsert bool
SkipOnUpdate bool
// Nullable will make sure that on Insert and Patch operations
// this field will not be ignored even if it is a NULL pointer.
Nullable bool
// Implement these functions if you want to override the default Scan/Value behavior
// for the target attribute.
Scan AttrScanner
Value AttrValuer
}
AttrModifier informs KSQL how to use this modifier
type AttrScanner ¶
type AttrScanner func(ctx context.Context, opInfo OpInfo, attrPtr interface{}, dbValue interface{}) error
AttrScanner describes the operation of deserializing an object received from the database.
type AttrValuer ¶
type AttrValuer func(ctx context.Context, opInfo OpInfo, inputValue interface{}) (outputValue interface{}, _ error)
AttrValuer describes the operation of serializing an object when saving it to the database.
type OpInfo ¶
type OpInfo struct {
// A string version of the name of one of
// the methods of the `ksql.Provider` interface, e.g. `Insert` or `Query`
Method string
// The string representing the current underlying database, e.g.:
// "postgres", "sqlite3", "mysql" or "sqlserver".
DriverName string
}
OpInfo contains information that might be used by a modifier to determine how it should behave.
Click to show internal directories.
Click to hide internal directories.