schema

package
v0.0.0-...-acd9bba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTypeAssertionFailed = errors.New("type assertion failed")

Functions

This section is empty.

Types

type Constant

type Constant interface {
	fmt.Stringer
	Val() any
	HashCode() int
	Equals(Constant) bool
	Compare(Constant) int
}

type ConstantInt32

type ConstantInt32 int32

func (ConstantInt32) AppliesTo

func (v ConstantInt32) AppliesTo(_ *Schema) bool

func (ConstantInt32) Compare

func (v ConstantInt32) Compare(c Constant) int

func (ConstantInt32) Equals

func (v ConstantInt32) Equals(c Constant) bool

func (ConstantInt32) Evaluate

func (v ConstantInt32) Evaluate(Valuable) (Constant, error)

func (ConstantInt32) HashCode

func (v ConstantInt32) HashCode() int

func (ConstantInt32) String

func (v ConstantInt32) String() string

func (ConstantInt32) Val

func (v ConstantInt32) Val() any

type ConstantStr

type ConstantStr string

func (ConstantStr) AppliesTo

func (v ConstantStr) AppliesTo(_ *Schema) bool

func (ConstantStr) Compare

func (v ConstantStr) Compare(c Constant) int

func (ConstantStr) Equals

func (v ConstantStr) Equals(c Constant) bool

func (ConstantStr) Evaluate

func (v ConstantStr) Evaluate(Valuable) (Constant, error)

func (ConstantStr) HashCode

func (v ConstantStr) HashCode() int

func (ConstantStr) String

func (v ConstantStr) String() string

func (ConstantStr) Val

func (v ConstantStr) Val() any

type Field

type Field struct {
	// contains filtered or unexported fields
}

func NewField

func NewField(typ FieldType, length int32) Field

func NewInt32Field

func NewInt32Field() Field

func NewVarcharField

func NewVarcharField(length int32) Field

type FieldName

type FieldName string

func (FieldName) AppliesTo

func (f FieldName) AppliesTo(s *Schema) bool

func (FieldName) Evaluate

func (f FieldName) Evaluate(v Valuable) (Constant, error)

type FieldType

type FieldType int32
const (
	Integer32 FieldType = iota
	Varchar
)

type Flag

type Flag int32
const (
	Empty Flag = iota
	Used
)

type Placeholder

type Placeholder int

func (Placeholder) AppliesTo

func (p Placeholder) AppliesTo(_ *Schema) bool

func (Placeholder) Compare

func (p Placeholder) Compare(Constant) int

func (Placeholder) Equals

func (p Placeholder) Equals(Constant) bool

func (Placeholder) Evaluate

func (p Placeholder) Evaluate(v Valuable) (Constant, error)

func (Placeholder) HashCode

func (p Placeholder) HashCode() int

func (Placeholder) String

func (p Placeholder) String() string

func (Placeholder) Val

func (p Placeholder) Val() any

type RID

type RID struct {
	// contains filtered or unexported fields
}

func NewRID

func NewRID(blockNum, slot int32) RID

func (RID) BlockNum

func (r RID) BlockNum() int32

func (RID) Equals

func (r RID) Equals(other RID) bool

func (RID) Slot

func (r RID) Slot() int32

func (RID) String

func (r RID) String() string

type Schema

type Schema struct {
	// contains filtered or unexported fields
}

func NewSchema

func NewSchema() Schema

func (*Schema) Add

func (s *Schema) Add(name FieldName, schema Schema)

func (*Schema) AddAll

func (s *Schema) AddAll(schema Schema)

func (*Schema) AddField

func (s *Schema) AddField(name FieldName, f Field)

func (*Schema) AddInt32Field

func (s *Schema) AddInt32Field(name FieldName)

func (*Schema) AddStrField

func (s *Schema) AddStrField(name FieldName, length int32)

func (*Schema) FieldNames

func (s *Schema) FieldNames() []FieldName

func (*Schema) HasField

func (s *Schema) HasField(name FieldName) bool

func (*Schema) Length

func (s *Schema) Length(name FieldName) int32

func (*Schema) Typ

func (s *Schema) Typ(name FieldName) FieldType

type Valuable

type Valuable interface {
	Val(fieldName FieldName) (Constant, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL