mysql

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

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

func F

func F(name string, args ...any) *dialect.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

	Tables []clause.Table
	clause.From
	clause.Where
	clause.OrderBy
	clause.Limit
	// contains filtered or unexported fields
}

Trying to represent the query structure as documented in https://dev.mysql.com/doc/refman/8.0/en/delete.html

func (*DeleteQuery) AppendHint added in v0.2.0

func (h *DeleteQuery) AppendHint(hint string)

func (*DeleteQuery) AppendModifier added in v0.2.0

func (h *DeleteQuery) AppendModifier(modifier T)

func (DeleteQuery) WriteSQL added in v0.2.0

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

type Expression added in v0.2.0

type Expression = dialect.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

type InsertQuery added in v0.2.0

type InsertQuery struct {
	clause.Values

	Table              any
	Columns            []string
	RowAlias           string
	ColumnAlias        []string
	Sets               []Set
	DuplicateKeyUpdate []Set
	// contains filtered or unexported fields
}

Trying to represent the query structure as documented in https://dev.mysql.com/doc/refman/8.0/en/insert.html

func (*InsertQuery) AppendHint added in v0.2.0

func (h *InsertQuery) AppendHint(hint string)

func (*InsertQuery) AppendModifier added in v0.2.0

func (h *InsertQuery) AppendModifier(modifier T)

func (*InsertQuery) AppendPartition added in v0.2.0

func (h *InsertQuery) AppendPartition(partitions ...string)

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 query structure as documented in https://dev.mysql.com/doc/refman/8.0/en/select.html

func (*SelectQuery) AppendHint added in v0.2.0

func (h *SelectQuery) AppendHint(hint string)

func (*SelectQuery) AppendModifier added in v0.2.0

func (h *SelectQuery) AppendModifier(modifier T)

func (*SelectQuery) SetInto added in v0.3.0

func (s *SelectQuery) SetInto(i any)

func (SelectQuery) WriteSQL added in v0.2.0

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

type Set added in v0.3.0

type Set struct {
	Col string
	Val any
}

func (Set) WriteSQL added in v0.3.0

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

type UpdateQuery added in v0.2.0

type UpdateQuery struct {
	clause.With
	clause.Set
	clause.From
	clause.Where
	clause.OrderBy
	clause.Limit
	// 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) AppendHint added in v0.2.0

func (h *UpdateQuery) AppendHint(hint string)

func (*UpdateQuery) AppendModifier added in v0.2.0

func (h *UpdateQuery) AppendModifier(modifier T)

func (UpdateQuery) WriteSQL added in v0.2.0

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

Directories

Path Synopsis
delete
qm
insert
qm
select
qm
update
qm

Jump to

Keyboard shortcuts

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