Documentation ¶
Index ¶
- Variables
- func AreEqual(row1, row2 Row, sch schema.Schema) bool
- func GetFieldByName(colName string, r Row, sch schema.Schema) (types.Value, bool)
- func GetFieldByNameWithDefault(colName string, defVal types.Value, r Row, sch schema.Schema) types.Value
- func GetInvalidCol(r Row, sch schema.Schema) (*schema.Column, error)
- func GetInvalidConstraint(r Row, sch schema.Schema) (*schema.Column, schema.ColConstraint, error)
- func IsEmpty(r Row) (b bool)
- func IsValid(r Row, sch schema.Schema) (bool, error)
- type Row
- type RowFormatFunc
- type TaggedValues
- func (tt TaggedValues) Get(tag uint64) (types.Value, bool)
- func (tt TaggedValues) GetWithDefault(tag uint64, def types.Value) types.Value
- func (tt TaggedValues) Iter(cb func(tag uint64, val types.Value) (stop bool, err error)) (bool, error)
- func (tt TaggedValues) NomsTupleForNonPKCols(nbf *types.NomsBinFormat, nonPKCols *schema.ColCollection) TupleVals
- func (tt TaggedValues) NomsTupleForPKCols(nbf *types.NomsBinFormat, pkCols *schema.ColCollection) TupleVals
- func (tt TaggedValues) Set(tag uint64, val types.Value) TaggedValues
- func (tt TaggedValues) String() string
- type TupleVals
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRowNotValid = errors.New("invalid row for current schema")
View Source
var Fmt = FieldSeparatedFmt(':')
Functions ¶
func GetFieldByName ¶
func GetInvalidCol ¶
GetInvalidCol returns the first column in the schema that fails a constraint, or nil if none do.
func GetInvalidConstraint ¶
GetInvalidConstraint returns the failed constraint for the row given (previously identified by IsValid) along with the column with that constraint. Note that if there is a problem with the row besides the constraint, the constraint return value will be nil.
Types ¶
type Row ¶
type Row interface { // Returns the noms map key for this row, using the schema provided. NomsMapKey(sch schema.Schema) types.LesserValuable // Returns the noms map value for this row, using the schema provided. NomsMapValue(sch schema.Schema) types.Valuable // Iterates over all the columns in the row. Columns that have no value set will not be visited. IterCols(cb func(tag uint64, val types.Value) (stop bool, err error)) (bool, error) // Iterates over all columns in the schema, using the value for the row. Columns that have no value set in this row // will still be visited, and receive a nil value. IterSchema(sch schema.Schema, cb func(tag uint64, val types.Value) (stop bool, err error)) (bool, error) // Returns the value for the column with the tag given, and a success bool. The value will be null if the row // doesn't contain a value for that tag. GetColVal(tag uint64) (types.Value, bool) // Sets a value for the column with the tag given, returning a new row with the update. SetColVal(tag uint64, val types.Value, sch schema.Schema) (Row, error) // ReduceToIndex reduces a row to only the columns contained in an index, including the parent table's primary // keys. Only the column tags that are in the index will be included in the reduced row. The full index does not // have to be matched. ReduceToIndex(idx schema.Index) (Row, error) // ReduceToIndexPartialKey reduces a row to only the columns contained in an index, not including the parent table's // primary keys. The Tuple is then returned, allowing all matching rows on an index to be found. ReduceToIndexPartialKey(idx schema.Index) (types.Tuple, error) Format() *types.NomsBinFormat }
func New ¶
func New(nbf *types.NomsBinFormat, sch schema.Schema, colVals TaggedValues) (Row, error)
type RowFormatFunc ¶
func FieldSeparatedFmt ¶
func FieldSeparatedFmt(delim rune) RowFormatFunc
type TaggedValues ¶
func GetTaggedVals ¶
func GetTaggedVals(row Row) (TaggedValues, error)
func ParseTaggedValues ¶
func ParseTaggedValues(tpl types.Tuple) (TaggedValues, error)
func (TaggedValues) GetWithDefault ¶
func (TaggedValues) NomsTupleForNonPKCols ¶
func (tt TaggedValues) NomsTupleForNonPKCols(nbf *types.NomsBinFormat, nonPKCols *schema.ColCollection) TupleVals
func (TaggedValues) NomsTupleForPKCols ¶
func (tt TaggedValues) NomsTupleForPKCols(nbf *types.NomsBinFormat, pkCols *schema.ColCollection) TupleVals
func (TaggedValues) Set ¶
func (tt TaggedValues) Set(tag uint64, val types.Value) TaggedValues
func (TaggedValues) String ¶
func (tt TaggedValues) String() string
Click to show internal directories.
Click to hide internal directories.