query

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package query helps maintain aliases to each table so that when joins and columns are added they can be properly aliased.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(multitenancyVal, model interface{}, filters tags.Filterable, associations []tags.Association, selectFields []string, filterMetadata *tags.TableMetadata) (*qp.Table, error)

Build takes the filter model and returns a query object. It takes the multitenancy value, current reflected value, and any tags

func Hydrate

func Hydrate(filterModel interface{}, tblAlias string, aliasMap map[string]qp.FieldDescriptor, rows *sql.Rows, meta *tags.TableMetadata) ([]*reflect.Value, error)

Hydrate takes the rows and pops them into the correct struct, in the correct order. This is usually called after you've built and executed the query model.

func New

func New(name string) *qp.Table

New returns a new table with a generated alias and the given name

func NewAliased

func NewAliased(name, alias, refPath string) *qp.Table

NewAliases returns a new table with the given alias

Types

This section is empty.

Jump to

Keyboard shortcuts

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