option

package
v0.28.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 0 Imported by: 8

Documentation

Index

Constants

View Source
const SortDirectionAscending = "ASC"

SortDirectionAscending is the token that designates that records should be sorted lowest to highest

View Source
const SortDirectionDescending = "DESC"

SortDirectionDescending is the token that designates that records should be sorted highest to lowest

View Source
const TypeFields = "FIELDS"

TypeFields is the token that designates the fields to be returned

View Source
const TypeFirstRow = "FIRSTROW"

TypeFirstRow is the token that designates the "row number" to begin results.

View Source
const TypeMaxRows = "MAXROWS"

TypeMaxRows is the token that designates the maximum number of records to be returned

View Source
const TypeSort = "SORT"

TypeSort is the token that designates a Sort order

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldsConfig added in v0.22.0

type FieldsConfig []string

FieldsConfig is a query option that limits the number of rows to be included in a dataset

func (FieldsConfig) Fields added in v0.22.0

func (fieldsConfig FieldsConfig) Fields() []string

Fields returns the maximum number of rows to include in a dataset

func (FieldsConfig) OptionType added in v0.22.0

func (fieldsConfig FieldsConfig) OptionType() string

OptionType identifies this record as a query option

type FirstRowConfig

type FirstRowConfig struct{}

FirstRowConfig is a query option that sets the first row to be returned in a dataset

func (FirstRowConfig) OptionType

func (firstRowConfig FirstRowConfig) OptionType() string

OptionType identifies this record as a query option

type MaxRowsConfig

type MaxRowsConfig int64

MaxRowsConfig is a query option that limits the number of rows to be included in a dataset

func (MaxRowsConfig) MaxRows

func (maxRowsConfig MaxRowsConfig) MaxRows() int64

MaxRows returns the maximum number of rows to include in a dataset

func (MaxRowsConfig) OptionType

func (maxRowsConfig MaxRowsConfig) OptionType() string

OptionType identifies this record as a query option

type Option

type Option interface {
	OptionType() string
}

Option is an interface that wraps all of the query options that can be used to modify a database query.

func Fields added in v0.22.0

func Fields(fields ...string) Option

Fields returns a query option that will limit the query results to a certain number of rows

func FirstRow

func FirstRow() Option

FirstRow returns a query option that will limit the query results to a certain number of rows

func MaxRows

func MaxRows(maxRows int64) Option

MaxRows returns a query option that will limit the query results to a certain number of rows

func SortAsc

func SortAsc(fieldName string) Option

SortAsc returns a query option that will sort the query results in ASCENDING order

func SortDesc

func SortDesc(fieldName string) Option

SortDesc returns a query option that will sort the query results in DESCENDING order

type SortConfig

type SortConfig struct {
	FieldName string
	Direction string
}

SortConfig identifies the field and direction to use when sorting a dataset

func (SortConfig) OptionType

func (sortConfig SortConfig) OptionType() string

OptionType identifies this record as a query option

Jump to

Keyboard shortcuts

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