query

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListByOperations

type ListByOperations interface {
	QueryBuilder
	Count() ListByOperations
	OrderBy(field string) ListByOperations
	// Name overrides the auto-generated query/method name
	Name(name string) ListByOperations
}

func ListBy

func ListBy(args ...interface{}) ListByOperations

ListBy creates a query to list records with filters Can accept either string field names (defaulting to Eq filter) or Filter objects Example: ListBy("org_id") or ListBy(filter.Range("age"), filter.Search("name"))

type Query

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

func (Query) GetFields

func (q Query) GetFields() []string

func (Query) GetFilters

func (q Query) GetFilters() []filter.Filter

func (Query) GetName

func (q Query) GetName() string

GetName returns the custom query name, or "" when auto-generated.

func (Query) GetOrderBy

func (q Query) GetOrderBy() string

func (Query) GetType

func (q Query) GetType() Type

func (Query) HasCount

func (q Query) HasCount() bool

func (Query) Name

func (q Query) Name(name string) QueryOperations

func (Query) Query

func (Query) Query()

marker method for sealed interface

type QueryBuilder

type QueryBuilder interface {
	Query()
}

func DefaultCRUD

func DefaultCRUD() QueryBuilder

DefaultCRUD expands to several queries, so it cannot be named

type QueryOperations

type QueryOperations interface {
	QueryBuilder
	// Name overrides the auto-generated query/method name
	Name(name string) QueryOperations
}

func Create

func Create() QueryOperations

func CreateBulk

func CreateBulk() QueryOperations

func Delete

func Delete() QueryOperations

func DeleteAll

func DeleteAll() QueryOperations

func Get

func Get() QueryOperations

func GetBy

func GetBy(fields ...string) QueryOperations

GetBy creates a query to get a record by one or more fields Example: GetBy("id") or GetBy("org_id", "email")

func ListAll

func ListAll() QueryOperations

func Update

func Update() QueryOperations

type Type

type Type string
const (
	TypeDefaultCRUD Type = "default_crud"
	TypeCreate      Type = "create"
	TypeCreateBulk  Type = "create_bulk"
	TypeGet         Type = "get"
	TypeUpdate      Type = "update"
	TypeDelete      Type = "delete"
	TypeDeleteAll   Type = "delete_all"
	TypeListAll     Type = "list_all"
	TypeGetBy       Type = "get_by"
	TypeListBy      Type = "list_by"
)

Jump to

Keyboard shortcuts

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