qrypgx

package
v0.0.0-...-ebfb46d Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-2-Clause Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	KindMany = 1 << iota
	KindOne
	KindCount
	KindScalar
	KindJoin
	KindJoined
	KindInline
	KindInlined
	KindJSON
	KindAlias
)

Variables

View Source
var Mod *mod.Src

Mod is the xelf module source for this package that ensures provider registration.

View Source
var Prov = qry.Backends.Register(&provider{}, "postgres", "postgresql", "qrypgx")

Functions

This section is empty.

Types

type Alias

type Alias map[*qry.Job]string

func (Alias) AsRef

func (a Alias) AsRef(j *qry.Job) string

func (Alias) ColRef

func (a Alias) ColRef(j *qry.Job, k string) string

type Backend

type Backend struct {
	DB *pgxpool.Pool
	*dom.Project
	*mig.Version
	// contains filtered or unexported fields
}

func New

func New(db *pgxpool.Pool, proj *dom.Project) *Backend

func (*Backend) Close

func (b *Backend) Close() error

Close satisfies the dataset interface but does not close the underlying connection pool.

func (*Backend) Exec

func (b *Backend) Exec(p *exp.Prog, j *qry.Job) (*exp.Lit, error)

func (*Backend) Keys

func (b *Backend) Keys() []string

func (*Backend) Proj

func (b *Backend) Proj() *dom.Project

func (*Backend) Stream

func (b *Backend) Stream(key string) (mig.Stream, error)

func (*Backend) Vers

func (b *Backend) Vers() *mig.Version

type Batch

type Batch struct {
	*qry.Doc
	List []*Query
	All  []*Query
}

func Analyse

func Analyse(bend qry.Backend, d *qry.Doc) (*Batch, error)

Analyse returns the next batch of queries for doc.

type Column

type Column struct {
	*qry.Job
	*qry.Field
	Sub *Query
	Key string
}

type Kind

type Kind uint

type Query

type Query struct {
	Kind Kind
	Alias
	*qry.Job
	Parent *Query
	Join   []*Query
	Deps   []*qry.Job
	Cols   []*Column
}

func (*Query) DependsOn

func (q *Query) DependsOn(j *qry.Job) bool

Jump to

Keyboard shortcuts

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