column

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage[PK, Col comparable] struct {
	// contains filtered or unexported fields
}

Storage 基于列式存储布局的存储器

func New

func New[PK, Col comparable]() *Storage[PK, Col]

func (*Storage[PK, Col]) AddRow

func (s *Storage[PK, Col]) AddRow(primaryKey PK)

AddRow 添加一行以默认值填充的数据

func (*Storage[PK, Col]) AddRows

func (s *Storage[PK, Col]) AddRows(primaryKeys []PK)

AddRows 批量添加数据

func (*Storage[PK, Col]) AddRowsWithValues

func (s *Storage[PK, Col]) AddRowsWithValues(primaryKeys []PK, values map[Col][]any)

AddRowsWithValues 批量添加数据

func (*Storage[PK, Col]) DelRow

func (s *Storage[PK, Col]) DelRow(primaryKey PK)

DelRow 删除一行数据

func (*Storage[PK, Col]) DelRows

func (s *Storage[PK, Col]) DelRows(primaryKeys []PK)

DelRows 批量删除数据

func (*Storage[PK, Col]) Get

func (s *Storage[PK, Col]) Get(primaryKey PK, col Col) any

Get 获取特定列数据

func (*Storage[PK, Col]) GetRow

func (s *Storage[PK, Col]) GetRow(primaryKey PK) map[Col]any

GetRow 获取一行数据

func (*Storage[PK, Col]) Migrate

func (s *Storage[PK, Col]) Migrate(target storage.Storage[PK, Col], primaryKes ...PK)

Migrate 迁移行

func (*Storage[PK, Col]) SetColumn

func (s *Storage[PK, Col]) SetColumn(col Col, defaultGetter func() any)

SetColumn 设置列

Jump to

Keyboard shortcuts

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