sql

package
v0.0.0-...-d1b82ce Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name string
}

func (Column) Between

func (c Column) Between(l string, u string) string

func (Column) Equal

func (c Column) Equal(v string) string

name these based on what reads well when constructing? or

func (Column) GreaterThan

func (c Column) GreaterThan(v string) string

func (Column) GreaterThanOrEqual

func (c Column) GreaterThanOrEqual(v string) string

func (Column) In

func (c Column) In(r []string) string

func (Column) LessThan

func (c Column) LessThan(v string) string

func (Column) LessThanOrEqual

func (c Column) LessThanOrEqual(v string) string

func (Column) Like

func (c Column) Like(p string) string

func (Column) NotEqual

func (c Column) NotEqual(v string) string

func (Column) NotIn

func (c Column) NotIn(r []string) string

func (Column) NotLike

func (c Column) NotLike(p string) string

type Columns

type Columns map[string]Column

type Query

type Query struct {
	// Language string // should support syntactic differences in mysql, postgres, ms sql etc
	// Version string // may be differences in symbols based on versions
	Database  string
	Table     string
	Procedure string
	Columns   Columns // TODO add support for table meta data, and can do some validation on the built query
	Query     string
}

dont think this should be called 'query' as it contains more information than just a simple query

func (*Query) And

func (q *Query) And(cond string) *Query

func (*Query) Call

func (q *Query) Call() *Query

func (*Query) Limit

func (q *Query) Limit(val int) *Query

func (*Query) Or

func (q *Query) Or(cond string) *Query

func (*Query) OrderByAsc

func (q *Query) OrderByAsc(col Column) *Query

func (*Query) OrderByDesc

func (q *Query) OrderByDesc(col Column) *Query

func (*Query) Param

func (q *Query) Param(p string) *Query

func (*Query) Select

func (q *Query) Select(cols []string) *Query

func (*Query) SelectAll

func (q *Query) SelectAll() *Query

func (*Query) SelectOne

func (q *Query) SelectOne() *Query

func (*Query) Where

func (q *Query) Where(cond string) *Query

Jump to

Keyboard shortcuts

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