psql

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeleteQM = deleteQM{}
View Source
var InsertQM = insertQM{}
View Source
var SelectQM = selectQM{}
View Source
var UpdateQM = updateQM{}

Functions

func Delete

func Delete(queryMods ...bob.Mod[*DeleteQuery]) bob.BaseQuery[*DeleteQuery]

func F

func F(name string, args ...any) *function

func Insert

func Insert(queryMods ...bob.Mod[*InsertQuery]) bob.BaseQuery[*InsertQuery]

func RawQuery

func RawQuery(q string, args ...any) bob.BaseQuery[expr.Raw]

func Select

func Select(queryMods ...bob.Mod[*SelectQuery]) bob.BaseQuery[*SelectQuery]

func Update

func Update(queryMods ...bob.Mod[*UpdateQuery]) bob.BaseQuery[*UpdateQuery]

Types

type DeleteQuery added in v0.2.0

type DeleteQuery struct {
	clause.With

	clause.Table
	clause.From
	clause.Where
	clause.Returning
	// contains filtered or unexported fields
}

Trying to represent the select query structure as documented in https://www.postgresql.org/docs/current/sql-delete.html

func (DeleteQuery) WriteSQL added in v0.2.0

func (d DeleteQuery) WriteSQL(w io.Writer, dl bob.Dialect, start int) ([]any, error)

type Dialect

type Dialect struct{}

func (Dialect) WriteArg

func (d Dialect) WriteArg(w io.Writer, position int)

func (Dialect) WriteQuoted

func (d Dialect) WriteQuoted(w io.Writer, s string)

type Expression added in v0.2.0

type Expression struct {
	expr.Chain[Expression, Expression]
}

func And

func And(args ...any) Expression

func Arg

func Arg(args ...any) Expression

func Concat

func Concat(args ...any) Expression

func Group

func Group(exps ...any) Expression

func Not

func Not(exp any) Expression

func Or

func Or(args ...any) Expression

func P

func P(exp any) Expression

func Placeholder

func Placeholder(n uint) Expression

func Quote

func Quote(ss ...string) Expression

func Raw

func Raw(query string, args ...any) Expression

func S

func S(s string) Expression

func X

func X(exp any, others ...any) Expression

func (Expression) BetweenSymmetric added in v0.2.0

func (x Expression) BetweenSymmetric(a, b any) Expression

BETWEEN SYMMETRIC a AND b

func (Expression) New added in v0.2.0

func (Expression) New(exp any) Expression

func (Expression) NotBetweenSymmetric added in v0.2.0

func (x Expression) NotBetweenSymmetric(a, b any) Expression

NOT BETWEEN SYMMETRIC a AND b

func (Expression) String added in v0.2.0

func (x Expression) String() string

Implements fmt.Stringer()

type InsertQuery added in v0.2.0

type InsertQuery struct {
	clause.With

	clause.Table
	clause.Values
	clause.Conflict
	clause.Returning
	// contains filtered or unexported fields
}

Trying to represent the select query structure as documented in https://www.postgresql.org/docs/current/sql-insert.html

func (InsertQuery) WriteSQL added in v0.2.0

func (i InsertQuery) WriteSQL(w io.Writer, d bob.Dialect, start int) ([]any, error)

type SelectQuery added in v0.2.0

Trying to represent the select query structure as documented in https://www.postgresql.org/docs/current/sql-select.html

func (SelectQuery) WriteSQL added in v0.2.0

func (s SelectQuery) WriteSQL(w io.Writer, d bob.Dialect, start int) ([]any, error)

type UpdateQuery added in v0.2.0

type UpdateQuery struct {
	clause.With

	clause.Table
	clause.Set
	clause.From
	clause.Where
	clause.Returning
	// contains filtered or unexported fields
}

Trying to represent the select query structure as documented in https://www.postgresql.org/docs/current/sql-update.html

func (UpdateQuery) WriteSQL added in v0.2.0

func (u UpdateQuery) WriteSQL(w io.Writer, d bob.Dialect, start int) ([]any, error)

type ValuesQuery

type ValuesQuery struct {
	// insert the group
	clause.OrderBy
	clause.Limit
	clause.Offset
	clause.Fetch
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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