index

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

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

Column is a single indexed column together with its sort direction.

func (Column) GetName

func (c Column) GetName() string

func (Column) IsDesc

func (c Column) IsDesc() bool

type Index

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

func (Index) Asc

func (i Index) Asc(field string) IndexOperations

Asc appends a column sorted ascending.

func (Index) Desc

func (i Index) Desc(field string) IndexOperations

Desc appends a column sorted descending.

func (Index) GetColumns

func (i Index) GetColumns() []Column

func (Index) GetFields

func (i Index) GetFields() []string

GetFields returns just the column names, in order.

func (Index) GetName

func (i Index) GetName() string

func (Index) GetType

func (i Index) GetType() Type

func (Index) Index

func (Index) Index()

marker method for sealed interface

func (Index) IsUnique

func (i Index) IsUnique() bool

func (Index) Name

func (i Index) Name(name string) IndexOperations

Name overrides the auto-generated index name.

func (Index) Unique

func (i Index) Unique() IndexOperations

Unique turns the index into a unique constraint.

type IndexBuilder

type IndexBuilder interface {
	Index()
}

func Primary

func Primary(fields ...string) IndexBuilder

type IndexOperations

type IndexOperations interface {
	IndexBuilder
	Unique() IndexOperations
	// Name overrides the auto-generated index name
	Name(name string) IndexOperations
	Asc(field string) IndexOperations
	Desc(field string) IndexOperations
}

IndexOperations exposes the fluent modifiers available on a Fields() index.

func Fields

func Fields(fields ...string) IndexOperations

type Type

type Type string
const (
	// TypePrimary marks a (compound) primary key.
	TypePrimary Type = "primary"
	// TypeIndex is a regular secondary index (optionally unique).
	TypeIndex Type = "index"
)

Jump to

Keyboard shortcuts

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