types

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DeallocatedPageErr = errors.Error("dellocated Page ID is passed.")
View Source
const InvalidPageID = PageID(-1)

InvalidPageID represents an invalid page GetPageId

View Source
const SizeOfLSN = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool added in v0.0.2

type Bool bool

func NewBoolFromBytes added in v0.0.2

func NewBoolFromBytes(data []byte) (ret_ Bool)

func (Bool) Serialize added in v0.0.2

func (flag Bool) Serialize() []byte

Serialize casts it to []byte

type Int32 added in v0.0.2

type Int32 int32

func NewInt32FromBytes added in v0.0.2

func NewInt32FromBytes(data []byte) (ret_ Int32)

func (Int32) Serialize added in v0.0.2

func (id Int32) Serialize() []byte

Serialize casts it to []byte

type LSN

type LSN int32

LSN is the type of the log identifier

func NewLSNFromBytes

func NewLSNFromBytes(data []byte) (ret LSN)

NewLSNFromBytes creates a LSN from []byte

func (LSN) AtomicAdd

func (lsn LSN) AtomicAdd(val int32)

func (LSN) Serialize

func (lsn LSN) Serialize() []byte

Serialize casts it to []byte

type PageID

type PageID int32

PageID is the type of the page identifier

func NewPageIDFromBytes

func NewPageIDFromBytes(data []byte) (ret PageID)

NewPageIDFromBytes creates a page id from []byte

func (PageID) IsValid

func (id PageID) IsValid() bool

IsValid checks if id is valid

func (PageID) Serialize

func (id PageID) Serialize() []byte

Serialize casts it to []byte

type TxnID

type TxnID int32

TxnID is the type of the transaction identifier

func NewTxnIDFromBytes

func NewTxnIDFromBytes(data []byte) (ret TxnID)

NewPageIDFromBytes creates a page id from []byte

func (*TxnID) AtomicAdd

func (id *TxnID) AtomicAdd(val int32)

func (TxnID) Serialize

func (id TxnID) Serialize() []byte

Serialize casts it to []byte

type TypeID

type TypeID int
const (
	Invalid TypeID = iota
	Boolean
	Tinyint
	Smallint
	Integer
	BigInt
	Decimal
	Float
	Varchar
	Timestamp
	Null
)

Every possible SQL type GetPageId

func (TypeID) Size

func (t TypeID) Size() uint32

type UInt16 added in v0.0.2

type UInt16 uint16

func NewUInt16FromBytes added in v0.0.2

func NewUInt16FromBytes(data []byte) (ret_ UInt16)

func (UInt16) Serialize added in v0.0.2

func (id UInt16) Serialize() []byte

Serialize casts it to []byte

type UInt32

type UInt32 uint32

func NewUInt32FromBytes

func NewUInt32FromBytes(data []byte) (ret_ UInt32)

func (UInt32) Serialize

func (id UInt32) Serialize() []byte

Serialize casts it to []byte

type UInt64 added in v0.0.2

type UInt64 uint64

func NewUInt64FromBytes added in v0.0.2

func NewUInt64FromBytes(data []byte) (ret_ UInt64)

func (UInt64) Serialize added in v0.0.2

func (id UInt64) Serialize() []byte

Serialize casts it to []byte

type Value

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

A value is an class that represents a view over SQL data stored in some materialized state. All values have a type and comparison functions, and implement other type-specific functionality.

func NewBoolean

func NewBoolean(value bool) Value

func NewFloat

func NewFloat(value float32) Value

func NewInteger

func NewInteger(value int32) Value

func NewNull

func NewNull() Value

it can be used only when you can not know value type to be compared or something

func NewValue added in v0.0.2

func NewValue(value interface{}) Value

func NewValueFromBytes

func NewValueFromBytes(data []byte, valueType TypeID) (ret *Value)

NewValueFromBytes is used for deserialization

func NewVarchar

func NewVarchar(value string) Value

func (Value) Add

func (v Value) Add(other *Value) *Value

func (Value) CompareEquals

func (v Value) CompareEquals(right Value) bool

func (Value) CompareGreaterThan

func (v Value) CompareGreaterThan(right Value) bool

func (Value) CompareGreaterThanOrEqual

func (v Value) CompareGreaterThanOrEqual(right Value) bool

func (Value) CompareLessThan

func (v Value) CompareLessThan(right Value) bool

func (Value) CompareLessThanOrEqual

func (v Value) CompareLessThanOrEqual(right Value) bool

func (Value) CompareNotEquals

func (v Value) CompareNotEquals(right Value) bool

func (Value) IsInfMax added in v0.0.2

func (v Value) IsInfMax() bool

func (Value) IsInfMin added in v0.0.2

func (v Value) IsInfMin() bool

func (Value) IsNull

func (v Value) IsNull() bool

func (Value) Max

func (v Value) Max(other *Value) *Value

func (Value) Min

func (v Value) Min(other *Value) *Value

func (Value) Serialize

func (v Value) Serialize() []byte

func (Value) SetInfMax added in v0.0.2

func (v Value) SetInfMax() *Value

func (Value) SetInfMin added in v0.0.2

func (v Value) SetInfMin() *Value

func (Value) SetNull

func (v Value) SetNull() *Value

note: (need to be) only way to get Value object which has NULL value

a value filed correspoding to value type is initialized to default value

func (Value) Size

func (v Value) Size() uint32

Size returns the size in bytes that the type will occupy inside the tuple

func (Value) ToBoolean

func (v Value) ToBoolean() bool

if you use this to get column value NULL value check is needed in general

func (Value) ToFloat

func (v Value) ToFloat() float32

if you use this to get column value NULL value check is needed in general

func (Value) ToIFValue added in v0.0.2

func (v Value) ToIFValue() interface{}

func (Value) ToInteger

func (v Value) ToInteger() int32

if you use this to get column value NULL value check is needed in general

func (Value) ToString

func (v Value) ToString() string

func (Value) ToVarchar

func (v Value) ToVarchar() string

if you use this to get column value NULL value check is needed in general

func (Value) ValueType

func (v Value) ValueType() TypeID

Jump to

Keyboard shortcuts

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