psql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And(args ...any) chain

func Arg

func Arg(args ...any) chain

func Concat

func Concat(args ...any) chain

func Delete

func Delete(queryMods ...query.Mod[*deleteQuery]) query.BaseQuery[*deleteQuery]

func F

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

func Group

func Group(exps ...any) chain

func Insert

func Insert(queryMods ...query.Mod[*insertQuery]) query.BaseQuery[*insertQuery]

func Not

func Not(exp any) chain

func Or

func Or(args ...any) chain

func P

func P(exp any) chain

func Placeholder

func Placeholder(n uint) chain

func Quote

func Quote(ss ...string) chain

func Raw

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

func RawQuery

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

func S

func S(s string) chain

func Select

func Select(queryMods ...query.Mod[*selectQuery]) query.BaseQuery[*selectQuery]

func Update

func Update(queryMods ...query.Mod[*updateQuery]) query.BaseQuery[*updateQuery]

func X

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

Types

type DeleteQM

type DeleteQM struct {
	mods.FromMod[*deleteQuery]
	// contains filtered or unexported fields
}

func (DeleteQM) CrossJoin

func (j DeleteQM) CrossJoin(e any) query.Mod[Q]

func (DeleteQM) From

func (qm DeleteQM) From(name any) query.Mod[*deleteQuery]

func (DeleteQM) FromAs

func (qm DeleteQM) FromAs(name any, alias string) query.Mod[*deleteQuery]

func (DeleteQM) FullJoin

func (j DeleteQM) FullJoin(e any) joinChain[Q]

func (DeleteQM) InnerJoin

func (j DeleteQM) InnerJoin(e any) joinChain[Q]

func (DeleteQM) Lateral

func (DeleteQM) Lateral() query.Mod[*clause.FromItem]

func (DeleteQM) LeftJoin

func (j DeleteQM) LeftJoin(e any) joinChain[Q]

func (DeleteQM) Only

func (qm DeleteQM) Only() query.Mod[*deleteQuery]

func (DeleteQM) Recursive

func (DeleteQM) Recursive(r bool) query.Mod[Q]

func (DeleteQM) Returning

func (qm DeleteQM) Returning(clauses ...any) query.Mod[*deleteQuery]

func (DeleteQM) RightJoin

func (j DeleteQM) RightJoin(e any) joinChain[Q]

func (DeleteQM) Using

func (qm DeleteQM) Using(table any, usingMods ...query.Mod[*clause.FromItem]) query.Mod[*deleteQuery]

func (DeleteQM) Where

func (qm DeleteQM) Where(e query.Expression) query.Mod[*deleteQuery]

func (DeleteQM) WhereClause

func (qm DeleteQM) WhereClause(clause string, args ...any) query.Mod[*deleteQuery]

func (DeleteQM) With

func (DeleteQM) With(name string, columns ...string) cteChain[Q]

func (DeleteQM) WithOrdinality

func (DeleteQM) WithOrdinality() query.Mod[*clause.FromItem]

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 InsertQM

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

func (InsertQM) Into

func (qm InsertQM) Into(name any, columns ...string) query.Mod[*insertQuery]

func (InsertQM) IntoAs

func (qm InsertQM) IntoAs(name any, alias string, columns ...string) query.Mod[*insertQuery]

func (InsertQM) OnConflict

func (qm InsertQM) OnConflict(column any, where ...any) mods.Conflict[*insertQuery]

The column to target. Will auto add brackets

func (InsertQM) OnConflictOnConstraint

func (qm InsertQM) OnConflictOnConstraint(constraint string) mods.Conflict[*insertQuery]

func (InsertQM) OverridingSystem

func (qm InsertQM) OverridingSystem() query.Mod[*insertQuery]

func (InsertQM) OverridingUser

func (qm InsertQM) OverridingUser() query.Mod[*insertQuery]

func (InsertQM) Query

func (qm InsertQM) Query(q query.Query) query.Mod[*insertQuery]

Insert from a query If Go allows type parameters on methods, limit this to select and raw

func (InsertQM) Recursive

func (InsertQM) Recursive(r bool) query.Mod[Q]

func (InsertQM) Returning

func (qm InsertQM) Returning(clauses ...any) query.Mod[*insertQuery]

func (InsertQM) Values

func (qm InsertQM) Values(clauses ...any) query.Mod[*insertQuery]

func (InsertQM) With

func (InsertQM) With(name string, columns ...string) cteChain[Q]

type SelectQM

type SelectQM struct {
	mods.FromMod[*selectQuery] // select *FROM*

	mods.TableAliasMod[*clause.FromItem] // Adding an alias to from item
	// contains filtered or unexported fields
}

func (SelectQM) Columns

func (SelectQM) Columns(clauses ...any) query.Mod[*selectQuery]

func (SelectQM) CrossJoin

func (j SelectQM) CrossJoin(e any) query.Mod[Q]

func (SelectQM) Distinct

func (SelectQM) Distinct(on ...any) query.Mod[*selectQuery]

func (SelectQM) Except

func (SelectQM) Except(q query.Query) query.Mod[*selectQuery]

func (SelectQM) ExceptAll

func (SelectQM) ExceptAll(q query.Query) query.Mod[*selectQuery]

func (SelectQM) Fetch

func (SelectQM) Fetch(count int64, withTies bool) query.Mod[*selectQuery]

func (SelectQM) ForKeyShare

func (SelectQM) ForKeyShare(tables ...string) lockChain[*selectQuery]

func (SelectQM) ForNoKeyUpdate

func (SelectQM) ForNoKeyUpdate(tables ...string) lockChain[*selectQuery]

func (SelectQM) ForShare

func (SelectQM) ForShare(tables ...string) lockChain[*selectQuery]

func (SelectQM) ForUpdate

func (SelectQM) ForUpdate(tables ...string) lockChain[*selectQuery]

func (SelectQM) FullJoin

func (j SelectQM) FullJoin(e any) joinChain[Q]

func (SelectQM) GroupBy

func (SelectQM) GroupBy(e any) query.Mod[*selectQuery]

func (SelectQM) GroupByDistinct

func (SelectQM) GroupByDistinct(distinct bool) query.Mod[*selectQuery]

func (SelectQM) Having

func (SelectQM) Having(e query.Expression) query.Mod[*selectQuery]

func (SelectQM) HavingClause

func (qm SelectQM) HavingClause(clause string, args ...any) query.Mod[*selectQuery]

func (SelectQM) InnerJoin

func (j SelectQM) InnerJoin(e any) joinChain[Q]

func (SelectQM) Intersect

func (SelectQM) Intersect(q query.Query) query.Mod[*selectQuery]

func (SelectQM) IntersectAll

func (SelectQM) IntersectAll(q query.Query) query.Mod[*selectQuery]

func (SelectQM) Lateral

func (SelectQM) Lateral() query.Mod[*clause.FromItem]

func (SelectQM) LeftJoin

func (j SelectQM) LeftJoin(e any) joinChain[Q]

func (SelectQM) Limit

func (SelectQM) Limit(count int64) query.Mod[*selectQuery]

func (SelectQM) Offset

func (SelectQM) Offset(count int64) query.Mod[*selectQuery]

func (SelectQM) Only

func (SelectQM) Only() query.Mod[*clause.FromItem]

func (SelectQM) OrderBy

func (SelectQM) OrderBy(e any) orderBy[*selectQuery]

func (SelectQM) Recursive

func (SelectQM) Recursive(r bool) query.Mod[Q]

func (SelectQM) RightJoin

func (j SelectQM) RightJoin(e any) joinChain[Q]

func (SelectQM) Union

func (SelectQM) Union(q query.Query) query.Mod[*selectQuery]

func (SelectQM) UnionAll

func (SelectQM) UnionAll(q query.Query) query.Mod[*selectQuery]

func (SelectQM) Where

func (SelectQM) Where(e query.Expression) query.Mod[*selectQuery]

func (SelectQM) WhereClause

func (qm SelectQM) WhereClause(clause string, args ...any) query.Mod[*selectQuery]

func (SelectQM) Window

func (SelectQM) Window(name string) windowMod[*selectQuery]

func (SelectQM) With

func (SelectQM) With(name string, columns ...string) cteChain[Q]

func (SelectQM) WithOrdinality

func (SelectQM) WithOrdinality() query.Mod[*clause.FromItem]

type UpdateQM

type UpdateQM struct {
	mods.FromMod[*updateQuery]
	// contains filtered or unexported fields
}

func (UpdateQM) CrossJoin

func (j UpdateQM) CrossJoin(e any) query.Mod[Q]

func (UpdateQM) FullJoin

func (j UpdateQM) FullJoin(e any) joinChain[Q]

func (UpdateQM) InnerJoin

func (j UpdateQM) InnerJoin(e any) joinChain[Q]

func (UpdateQM) Lateral

func (UpdateQM) Lateral() query.Mod[*clause.FromItem]

func (UpdateQM) LeftJoin

func (j UpdateQM) LeftJoin(e any) joinChain[Q]

func (UpdateQM) Only

func (qm UpdateQM) Only() query.Mod[*updateQuery]

func (UpdateQM) Recursive

func (UpdateQM) Recursive(r bool) query.Mod[Q]

func (UpdateQM) Returning

func (qm UpdateQM) Returning(clauses ...any) query.Mod[*updateQuery]

func (UpdateQM) RightJoin

func (j UpdateQM) RightJoin(e any) joinChain[Q]

func (UpdateQM) Set

func (qm UpdateQM) Set(a string, b any) query.Mod[*updateQuery]

func (UpdateQM) SetArg

func (qm UpdateQM) SetArg(a string, b any) query.Mod[*updateQuery]

func (UpdateQM) Table

func (qm UpdateQM) Table(name any) query.Mod[*updateQuery]

func (UpdateQM) TableAs

func (qm UpdateQM) TableAs(name any, alias string) query.Mod[*updateQuery]

func (UpdateQM) Where

func (qm UpdateQM) Where(e query.Expression) query.Mod[*updateQuery]

func (UpdateQM) WhereClause

func (qm UpdateQM) WhereClause(clause string, args ...any) query.Mod[*updateQuery]

func (UpdateQM) With

func (UpdateQM) With(name string, columns ...string) cteChain[Q]

func (UpdateQM) WithOrdinality

func (UpdateQM) WithOrdinality() query.Mod[*clause.FromItem]

type ValuesQuery

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

Jump to

Keyboard shortcuts

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