package core import "TsDB2/DB/core/types" type EqCondition struct { Field string Value interface{} Type types.FieldType } func Eq(field string, value interface{}, typ types.FieldType) Condition { return EqCondition{Field: field, Value: value, Type: typ} } func (c EqCondition) Fields() []string { return []string{c.Field} } func (c EqCondition) Match(row []byte, table *Table) bool { fieldIdx := table.findFieldIndex(c.Field) if fieldIdx < 0 { return false } offset, ok := table.getVersionedOffset(row, fieldIdx) if !ok { return false } return table.compareValue(row, offset, c.Type, c.Value) }