query

package
v1.26.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 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 DefaultQueryBuilder

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

DefaultQueryBuilder allows to create basic queries dynamically/programmatically

func (*DefaultQueryBuilder) GetFields

func (qb *DefaultQueryBuilder) GetFields() []string

GetFields returns the selected fields

func (*DefaultQueryBuilder) GetFilters

func (qb *DefaultQueryBuilder) GetFilters() map[string]interface{}

GetFilters returns all conditions to filter data

func (*DefaultQueryBuilder) Where

func (qb *DefaultQueryBuilder) Where(field string, value interface{})

Where allows adding conditions to filter data

func (*DefaultQueryBuilder) WithFields

func (qb *DefaultQueryBuilder) WithFields(fields ...string)

WithFields selects the specified fields

type QueryBuilder

type QueryBuilder interface {
	// GetFields returns the selected fields
	GetFields() []string
	// GetFilters returns all conditions to filter data
	GetFilters() map[string]interface{}
	// Where allows adding conditions to filter data
	Where(string, interface{})
	// WithFields selects the specified fields
	WithFields(...string)
}

QueryBuilder allows to create queries dynamically/programmatically

func NewDefaultQueryBuilder

func NewDefaultQueryBuilder() QueryBuilder

NewDefaultQueryBuilder creates a new instance of QueryBuilder

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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