syntax

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildExpr

func BuildExpr(expr string, vals ...interface{}) (string, error)

BuildExpr assigns the values to '?' of the expression.

func BuildExprWithoutQuotes

func BuildExprWithoutQuotes(expr string, vals ...interface{}) (string, error)

BuildExprWithoutQuotes assigns the values to '?' of the expression with single quotes.

Types

type ClauseSet

type ClauseSet struct {
	Keyword string
	Value   string
	Parens  bool
}

ClauseSet is the pair of clause keyword and its values. If Parens is true, ClauseSet would be enclosed by parentheses.

func (*ClauseSet) Build

func (ss *ClauseSet) Build() string

Build makes clause with string.

func (*ClauseSet) BuildValue

func (ss *ClauseSet) BuildValue() string

BuildValue makes clause value with string.

func (*ClauseSet) WriteKeyword

func (ss *ClauseSet) WriteKeyword(clause string)

WriteKeyword writes caluse keyword to ClauseSet.

func (*ClauseSet) WriteValue

func (ss *ClauseSet) WriteValue(value string)

WriteValue writes value to ClauseSet.

type Column

type Column struct {
	Name  string
	Alias string
}

Column is column term.

func NewColumn

func NewColumn(column string) *Column

NewColumn creates new Column instance.

func (*Column) Build

func (c *Column) Build() string

Build makes column term with string.

type RawClause

type RawClause struct {
	RawStr string
	Values []interface{}
}

RawClause is the raw string clause which can be defined by user.

func (*RawClause) Build

func (r *RawClause) Build() (interfaces.ClauseSet, error)

Build creates the pair of clause and value as ClauseSet.

func (*RawClause) String

func (r *RawClause) String() string

type Table

type Table struct {
	Name  string
	Alias string
}

Table is table term.

func NewTable

func NewTable(table string) *Table

NewTable creates new Table instance.

func (*Table) Build

func (t *Table) Build() string

Build makes table term with string.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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