queries

package
v0.0.0-...-f9144f1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_PAGE_SIZE = 50
)

Variables

This section is empty.

Functions

func ProcessUpdateQuery

func ProcessUpdateQuery(
	queryStrings *[]string, allParams *[]table.ParameterOption, t *WriteSingleTableQueryImpl,
) error

func ProcessUpsertQuery

func ProcessUpsertQuery(
	queryStrings *[]string, allParams *[]table.ParameterOption, t *WriteSingleTableQueryImpl,
) error

Types

type FormatQueryResult

type FormatQueryResult struct {
	QueryText   string
	QueryParams *table.QueryParameters
}

type OrderSpec

type OrderSpec struct {
	Field string
	Desc  bool
}

func NewOrderSpec

func NewOrderSpec(order *pb.ListBackupsOrder) (*OrderSpec, error)

type PageSpec

type PageSpec struct {
	Limit  uint64
	Offset uint64
}

func NewPageSpec

func NewPageSpec(pageSize uint32, pageToken string) (*PageSpec, error)

type QueryFilter

type QueryFilter struct {
	Field  string
	Values []table_types.Value
	IsLike bool
}

type ReadTableQuery

type ReadTableQuery interface {
	MakeFilterString() string
	FormatQuery(ctx context.Context) (*FormatQueryResult, error)
}

type ReadTableQueryImpl

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

func NewReadTableQuery

func NewReadTableQuery(options ...ReadTableQueryOption) *ReadTableQueryImpl

func (*ReadTableQueryImpl) AddTableQueryParam

func (d *ReadTableQueryImpl) AddTableQueryParam(paramValue table_types.Value) string

func (*ReadTableQueryImpl) FormatOrder

func (d *ReadTableQueryImpl) FormatOrder() *string

func (*ReadTableQueryImpl) FormatPage

func (d *ReadTableQueryImpl) FormatPage() *string

func (*ReadTableQueryImpl) FormatQuery

func (d *ReadTableQueryImpl) FormatQuery(ctx context.Context) (*FormatQueryResult, error)

func (*ReadTableQueryImpl) MakeFilterString

func (d *ReadTableQueryImpl) MakeFilterString() string

type ReadTableQueryOption

type ReadTableQueryOption func(*ReadTableQueryImpl)

func WithOrderBy

func WithOrderBy(spec OrderSpec) ReadTableQueryOption

func WithPageSpec

func WithPageSpec(spec PageSpec) ReadTableQueryOption

func WithParameters

func WithParameters(params ...table.ParameterOption) ReadTableQueryOption

func WithQueryFilters

func WithQueryFilters(filters ...QueryFilter) ReadTableQueryOption

func WithRawQuery

func WithRawQuery(rawQuery string) ReadTableQueryOption

func WithTableName

func WithTableName(tableName string) ReadTableQueryOption

type WriteQueryBulderFactory

type WriteQueryBulderFactory func() WriteTableQuery

type WriteSingleTableQueryImpl

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

func BuildCreateBackupQuery

func BuildCreateBackupQuery(b types.Backup, index int) WriteSingleTableQueryImpl

func BuildCreateBackupScheduleQuery

func BuildCreateBackupScheduleQuery(schedule types.BackupSchedule, index int) WriteSingleTableQueryImpl

func BuildCreateOperationQuery

func BuildCreateOperationQuery(operation types.Operation, index int) WriteSingleTableQueryImpl

func BuildUpdateBackupQuery

func BuildUpdateBackupQuery(backup types.Backup, index int) WriteSingleTableQueryImpl

func BuildUpdateBackupScheduleQuery

func BuildUpdateBackupScheduleQuery(schedule types.BackupSchedule, index int) WriteSingleTableQueryImpl

func BuildUpdateOperationQuery

func BuildUpdateOperationQuery(operation types.Operation, index int) WriteSingleTableQueryImpl

func (*WriteSingleTableQueryImpl) AddUpdateId

func (d *WriteSingleTableQueryImpl) AddUpdateId(value table_types.Value)

func (*WriteSingleTableQueryImpl) AddValueParam

func (d *WriteSingleTableQueryImpl) AddValueParam(name string, value table_types.Value)

func (*WriteSingleTableQueryImpl) GetParamNames

func (d *WriteSingleTableQueryImpl) GetParamNames() []string

type WriteTableQuery

type WriteTableQuery interface {
	FormatQuery(ctx context.Context) (*FormatQueryResult, error)
	WithCreateBackup(backup types.Backup) WriteTableQuery
	WithCreateOperation(operation types.Operation) WriteTableQuery
	WithCreateBackupSchedule(schedule types.BackupSchedule) WriteTableQuery
	WithUpdateBackup(backup types.Backup) WriteTableQuery
	WithUpdateOperation(operation types.Operation) WriteTableQuery
	WithUpdateBackupSchedule(schedule types.BackupSchedule) WriteTableQuery
}

func NewWriteTableQuery

func NewWriteTableQuery() WriteTableQuery

func NewWriteTableQueryMock

func NewWriteTableQueryMock() WriteTableQuery

type WriteTableQueryImpl

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

func (*WriteTableQueryImpl) FormatQuery

func (d *WriteTableQueryImpl) FormatQuery(ctx context.Context) (*FormatQueryResult, error)

func (*WriteTableQueryImpl) WithCreateBackup

func (d *WriteTableQueryImpl) WithCreateBackup(backup types.Backup) WriteTableQuery

func (*WriteTableQueryImpl) WithCreateBackupSchedule

func (d *WriteTableQueryImpl) WithCreateBackupSchedule(schedule types.BackupSchedule) WriteTableQuery

func (*WriteTableQueryImpl) WithCreateOperation

func (d *WriteTableQueryImpl) WithCreateOperation(operation types.Operation) WriteTableQuery

func (*WriteTableQueryImpl) WithUpdateBackup

func (d *WriteTableQueryImpl) WithUpdateBackup(backup types.Backup) WriteTableQuery

func (*WriteTableQueryImpl) WithUpdateBackupSchedule

func (d *WriteTableQueryImpl) WithUpdateBackupSchedule(schedule types.BackupSchedule) WriteTableQuery

func (*WriteTableQueryImpl) WithUpdateOperation

func (d *WriteTableQueryImpl) WithUpdateOperation(operation types.Operation) WriteTableQuery

type WriteTableQueryImplOption

type WriteTableQueryImplOption func(*WriteTableQueryImpl)

type WriteTableQueryMock

type WriteTableQueryMock struct {
	Operation      types.Operation
	Backup         types.Backup
	BackupSchedule types.BackupSchedule
}

func (*WriteTableQueryMock) FormatQuery

func (*WriteTableQueryMock) WithCreateBackup

func (w *WriteTableQueryMock) WithCreateBackup(backup types.Backup) WriteTableQuery

func (*WriteTableQueryMock) WithCreateBackupSchedule

func (w *WriteTableQueryMock) WithCreateBackupSchedule(schedule types.BackupSchedule) WriteTableQuery

func (*WriteTableQueryMock) WithCreateOperation

func (w *WriteTableQueryMock) WithCreateOperation(operation types.Operation) WriteTableQuery

func (*WriteTableQueryMock) WithUpdateBackup

func (w *WriteTableQueryMock) WithUpdateBackup(backup types.Backup) WriteTableQuery

func (*WriteTableQueryMock) WithUpdateBackupSchedule

func (w *WriteTableQueryMock) WithUpdateBackupSchedule(schedule types.BackupSchedule) WriteTableQuery

func (*WriteTableQueryMock) WithUpdateOperation

func (w *WriteTableQueryMock) WithUpdateOperation(operation types.Operation) WriteTableQuery

type WriteTableQueryMockOption

type WriteTableQueryMockOption func(*WriteTableQueryMock)

Jump to

Keyboard shortcuts

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