sqlbuilder

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 3 Imported by: 3

README

sqlbuilder

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func NewBuilder

func NewBuilder() *Builder

func (*Builder) And

func (b *Builder) And(cond Condition) *Builder

And implements Keyword.

func (*Builder) Asc added in v0.0.2

func (b *Builder) Asc() *Builder

Asc implements Keyword.

func (*Builder) Columns added in v0.0.2

func (b *Builder) Columns(fields ...Field) *Builder

Columns implements Keyword.

func (*Builder) DeleteFrom added in v0.0.2

func (b *Builder) DeleteFrom(table Table) *Builder

DeleteFrom implements Keyword.

func (*Builder) Desc added in v0.0.2

func (b *Builder) Desc() *Builder

Desc implements Keyword.

func (*Builder) ForUpdate added in v0.0.2

func (b *Builder) ForUpdate() *Builder

ForUpdate implements Keyword.

func (*Builder) From

func (b *Builder) From(tables ...Table) *Builder

func (*Builder) InsertInto added in v0.0.2

func (b *Builder) InsertInto(table Table) *Builder

InsertInto implements Keyword.

func (*Builder) Limit added in v0.0.2

func (b *Builder) Limit() *Builder

Limit implements Keyword.

func (*Builder) Or added in v0.0.2

func (b *Builder) Or(cond Condition) *Builder

Or implements Keyword.

func (*Builder) OrderBy added in v0.0.2

func (b *Builder) OrderBy(fields ...Field) *Builder

OrderBy implements Keyword.

func (*Builder) Select

func (b *Builder) Select(fields ...Field) *Builder

func (*Builder) Set added in v0.0.2

func (b *Builder) Set(fields ...Field) *Builder

Set implements Keyword.

func (*Builder) String

func (b *Builder) String() string

String implements Keyword.

func (*Builder) Update added in v0.0.2

func (b *Builder) Update(table Table) *Builder

Update implements Keyword.

func (*Builder) Where

func (b *Builder) Where(cond Condition) *Builder

type Condition

type Condition interface {
	fmt.Stringer
}

type Equal

type Equal struct {
	Left  Field
	Right Field
}

func (Equal) String

func (e Equal) String() string

String implements Condition.

type Field

type Field string

func (Field) As

func (f Field) As(alias Field) Field

As implements FieldModifier.

func (Field) Assign added in v0.0.2

func (f Field) Assign() Field

Assign implements FieldModifier.

func (Field) Count

func (f Field) Count() Field

Count implements FieldModifier.

func (Field) Named

func (f Field) Named() Field

Named implements FieldModifier.

func (Field) Of

func (f Field) Of(alias Table) Field

Of implements FieldModifier.

func (Field) String

func (f Field) String() string

String implements FieldModifier.

type FieldModifier

type FieldModifier interface {
	fmt.Stringer
	Count() Field
	As(Field) Field
	Of(Table) Field
	Named() Field
	Assign() Field
}

type Keyword

type Keyword interface {
	fmt.Stringer
	Select(...Field) *Builder
	From(...Table) *Builder
	Where(Condition) *Builder
	And(Condition) *Builder
	Or(Condition) *Builder
	ForUpdate() *Builder
	OrderBy(...Field) *Builder
	Asc() *Builder
	Desc() *Builder
	Limit() *Builder
	InsertInto(Table) *Builder
	Columns(...Field) *Builder
	Update(Table) *Builder
	Set(...Field) *Builder
	DeleteFrom(Table) *Builder
}

type Table

type Table string

func (Table) As

func (t Table) As(alias Table) Table

As implements Modifier.

func (Table) Field

func (t Table) Field(name string) Field

Field implements TableModifier.

func (Table) String

func (t Table) String() string

String implements Modifier.

type TableModifier

type TableModifier interface {
	fmt.Stringer
	As(Table) Table
	Field(string) Field
}

Jump to

Keyboard shortcuts

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