models

package
v5.4.100 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndFragment

type AndFragment []ConditionFragment

AndFragment combines sub-fragments with AND operator

func (AndFragment) GetConditionFragment

func (a AndFragment) GetConditionFragment(c *PositionalCounter) (string, []interface{})

GetConditionFragment returns fragment with its parameter

type ConditionFragment

type ConditionFragment interface {
	// GetConditionFragment returns ConditionFragment stringified
	GetConditionFragment(*PositionalCounter) (string, []interface{})
}

ConditionFragment represents a condition fragment

type ConstantFragment

type ConstantFragment struct {
	Constant string
}

ConstantFragment holds constant expression, without parameters

func (*ConstantFragment) GetConditionFragment

func (c *ConstantFragment) GetConditionFragment(*PositionalCounter) (string, []interface{})

GetConditionFragment returns the constant fragment

type DBInterface

type DBInterface interface {
	Exec(ctx context.Context, query string, args ...any) (pgconn.CommandTag, error)
	Query(ctx context.Context, query string, args ...any) (pgx.Rows, error)
	QueryRow(ctx context.Context, query string, args ...any) pgx.Row
}

DBInterface holds common operations for sql.DB and sql.Tx

type OrFragment

type OrFragment []ConditionFragment

OrFragment combines sub-fragments with OR operator

func (OrFragment) GetConditionFragment

func (o OrFragment) GetConditionFragment(c *PositionalCounter) (string, []interface{})

GetConditionFragment returns fragment with its parameter

type PositionalCounter

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

PositionalCounter generates positional parameter markers

func (*PositionalCounter) Get

func (p *PositionalCounter) Get() string

Get generates next positional parameter marker

type UnaryFragment

type UnaryFragment struct {
	Frag  string
	Param interface{}
}

UnaryFragment holds fragment with one parameter

func (*UnaryFragment) GetConditionFragment

func (u *UnaryFragment) GetConditionFragment(p *PositionalCounter) (string, []interface{})

GetConditionFragment returns fragment with its parameter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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