Documentation
¶
Index ¶
- Constants
- func TimeLayout(tz bool, precision int) string
- func TimestampLayout(tz bool, precision int) string
- type BodyMetaPath
- type Column
- type Dialect
- type GenericTableCodec
- func (t *GenericTableCodec) AttributeExpression(col string) (out string, err error)
- func (t *GenericTableCodec) Columns() []Column
- func (t *GenericTableCodec) Decode(buf []byte, r dal.ValueSetter) (err error)
- func (t *GenericTableCodec) Encode(r dal.ValueGetter) (_ []byte, err error)
- func (t *GenericTableCodec) GetColumn(name string) (c Column, ok bool)
- func (t *GenericTableCodec) Ident() string
- type ID
- type Nuances
- type PayloadEntry
- type SimpleJsonDocColumn
- func (c *SimpleJsonDocColumn) Attribute() *dal.Attribute
- func (c *SimpleJsonDocColumn) Decode(raw any, r dal.ValueSetter) (err error)
- func (c *SimpleJsonDocColumn) DecodeOld(raw any, r dal.ValueSetter) (err error)
- func (c *SimpleJsonDocColumn) Encode(r dal.ValueGetter) (_ any, err error)
- func (c *SimpleJsonDocColumn) IsPrimaryKey() bool
- func (c *SimpleJsonDocColumn) Name() string
- func (c *SimpleJsonDocColumn) Type() Type
- type SingleValueColumn
- func (c *SingleValueColumn) Attribute() *dal.Attribute
- func (c *SingleValueColumn) Decode(raw any, r dal.ValueSetter) error
- func (c *SingleValueColumn) Encode(r dal.ValueGetter) (any, error)
- func (c *SingleValueColumn) IsPrimaryKey() bool
- func (c *SingleValueColumn) Name() string
- func (c *SingleValueColumn) Type() Type
- type TableCodec
- type Type
- type TypeBoolean
- type TypeDate
- type TypeEnum
- type TypeGeometry
- type TypeID
- type TypeJSON
- type TypeNumber
- type TypeRef
- type TypeText
- type TypeTime
- type TypeTimestamp
- type XRequest
Constants ¶
View Source
const (
DateLayout = "2006-01-02"
)
Variables ¶
This section is empty.
Functions ¶
func TimeLayout ¶
func TimestampLayout ¶
Types ¶
type BodyMetaPath ¶
type BodyMetaPath struct {
TotalCount string
}
type Dialect ¶
type Dialect interface {
// TypeWrap returns driver's type implementation for a particular attribute type
TypeWrap(dal.Type) Type
MapOpParams(op string) (method string, endpoint string, err error)
AddSort(req XRequest, field string, desc bool) (XRequest, error)
AddLimit(req XRequest, limit uint) (XRequest, error)
EncrichEndpoint(endpoint string, xr XRequest) (out string)
SearchDataPath() string
SearchMetaPath() BodyMetaPath
EncodeBodyInsert(ee ...PayloadEntry) ([]byte, error)
ExtractInsertMeta(body []byte) (map[string]any, error)
DecodeBodySelect(body []byte) (map[string]any, error)
}
type GenericTableCodec ¶
type GenericTableCodec struct {
// contains filtered or unexported fields
}
GenericTableCodec is a generic implementation of TableCodec
func NewTableCodec ¶
func NewTableCodec(m *dal.Model, d Dialect) *GenericTableCodec
func (*GenericTableCodec) AttributeExpression ¶
func (t *GenericTableCodec) AttributeExpression(col string) (out string, err error)
func (*GenericTableCodec) Columns ¶
func (t *GenericTableCodec) Columns() []Column
func (*GenericTableCodec) Decode ¶
func (t *GenericTableCodec) Decode(buf []byte, r dal.ValueSetter) (err error)
func (*GenericTableCodec) Encode ¶
func (t *GenericTableCodec) Encode(r dal.ValueGetter) (_ []byte, err error)
func (*GenericTableCodec) GetColumn ¶
func (t *GenericTableCodec) GetColumn(name string) (c Column, ok bool)
func (*GenericTableCodec) Ident ¶
func (t *GenericTableCodec) Ident() string
type ID ¶
nullUint64 represents an uint64 that may be null. nullUint64 implements the Scanner interface so it can be used as a scan dåestination, similar to NullString.
type PayloadEntry ¶
type SimpleJsonDocColumn ¶
type SimpleJsonDocColumn struct {
// contains filtered or unexported fields
}
func (*SimpleJsonDocColumn) Attribute ¶
func (c *SimpleJsonDocColumn) Attribute() *dal.Attribute
func (*SimpleJsonDocColumn) Decode ¶
func (c *SimpleJsonDocColumn) Decode(raw any, r dal.ValueSetter) (err error)
func (*SimpleJsonDocColumn) DecodeOld ¶
func (c *SimpleJsonDocColumn) DecodeOld(raw any, r dal.ValueSetter) (err error)
func (*SimpleJsonDocColumn) Encode ¶
func (c *SimpleJsonDocColumn) Encode(r dal.ValueGetter) (_ any, err error)
func (*SimpleJsonDocColumn) IsPrimaryKey ¶
func (c *SimpleJsonDocColumn) IsPrimaryKey() bool
func (*SimpleJsonDocColumn) Name ¶
func (c *SimpleJsonDocColumn) Name() string
func (*SimpleJsonDocColumn) Type ¶
func (c *SimpleJsonDocColumn) Type() Type
type SingleValueColumn ¶
type SingleValueColumn struct {
// contains filtered or unexported fields
}
func NewSingleValueColumn ¶
func NewSingleValueColumn(d Dialect, a *dal.Attribute) *SingleValueColumn
func (*SingleValueColumn) Attribute ¶
func (c *SingleValueColumn) Attribute() *dal.Attribute
func (*SingleValueColumn) Decode ¶
func (c *SingleValueColumn) Decode(raw any, r dal.ValueSetter) error
func (*SingleValueColumn) Encode ¶
func (c *SingleValueColumn) Encode(r dal.ValueGetter) (any, error)
func (*SingleValueColumn) IsPrimaryKey ¶
func (c *SingleValueColumn) IsPrimaryKey() bool
func (*SingleValueColumn) Name ¶
func (c *SingleValueColumn) Name() string
func (*SingleValueColumn) Type ¶
func (c *SingleValueColumn) Type() Type
type TableCodec ¶
type TableCodec interface {
Columns() []Column
Ident() string
Encode(r dal.ValueGetter) (_ []byte, err error)
Decode(buf []byte, r dal.ValueSetter) (err error)
AttributeExpression(col string) (out string, err error)
}
TableCodec is an RDBMS representation of data.Model structure and its arguments
type Type ¶
type TypeBoolean ¶
type TypeBoolean struct{ *dal.TypeBoolean }
type TypeGeometry ¶
type TypeGeometry struct{ *dal.TypeGeometry }
type TypeNumber ¶
type TypeNumber struct{ *dal.TypeNumber }
type TypeTimestamp ¶
type TypeTimestamp struct{ *dal.TypeTimestamp }
Click to show internal directories.
Click to hide internal directories.