option

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 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 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 FirstRowConfig

type FirstRowConfig int

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

func (FirstRowConfig) FirstRow

func (firstRowConfig FirstRowConfig) FirstRow() int

FirstRow returns the first row of the dataset to return

func (FirstRowConfig) OptionType

func (firstRowConfig FirstRowConfig) OptionType() string

OptionType identifies this record as a query option

type MaxRowsConfig

type MaxRowsConfig int

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

func (MaxRowsConfig) MaxRows

func (maxRowsConfig MaxRowsConfig) MaxRows() int

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 FirstRow

func FirstRow(firstRow int64) 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