sqlbuilder

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 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) From

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

func (*Builder) Select

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

func (*Builder) String

func (b *Builder) String() string

String 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 string) Field

As 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(tableAlias string) 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(string) Field
	Of(string) Field
	Named() Field
}

type Keyword

type Keyword interface {
	fmt.Stringer
	Select(...Field) *Builder
	From(...Table) *Builder
	Where(Condition) *Builder
	And(Condition) *Builder
}

type Table

type Table string

func (Table) As

func (t Table) As(alias string) 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(string) Table
	Field(string) Field
}

Jump to

Keyboard shortcuts

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