Documentation ¶
Index ¶
- Variables
- func EndsLike(s string, escape ...rune) string
- func EscapeLike(s string, escape ...rune) string
- func EscapeString(s string) string
- func In(col string, arg any) (sql string, args []any)
- func NotIn(col string, arg any) (sql string, args []any)
- func Question(n int) string
- func Questions(n int) []string
- func QuoteDriver(driverName string, quoter Quoter)
- func StartsLike(s string, escape ...rune) string
- func StringLike(s string, escape ...rune) string
- type Builder
- func (b *Builder) Build() (string, []any)
- func (b *Builder) Columns(cols ...string) *Builder
- func (b *Builder) Delete(tb string) *Builder
- func (b *Builder) Distinct(cols ...string) *Builder
- func (b *Builder) From(tb string) *Builder
- func (b *Builder) In(col string, arg any) *Builder
- func (b *Builder) Insert(tb string) *Builder
- func (b *Builder) Limit(limit int) *Builder
- func (b *Builder) NotIn(col string, arg any) *Builder
- func (b *Builder) Offset(offset int) *Builder
- func (b *Builder) Order(order string) *Builder
- func (b *Builder) Params() []any
- func (b *Builder) SQL() string
- func (b *Builder) Select(cols ...string) *Builder
- func (b *Builder) Set(col string, args ...any) *Builder
- func (b *Builder) Update(tb string) *Builder
- func (b *Builder) Values(vals ...string) *Builder
- func (b *Builder) Where(q string, args ...any) *Builder
- type QuoteMarks
- type Quoter
- type SqlReader
Constants ¶
This section is empty.
Variables ¶
var ( QuoteMarksDefault = QuoteMarks{'"', '"'} QuoteMarksMSSQL = QuoteMarks{'[', ']'} QuoteMarksMYSQL = QuoteMarks{'`', '`'} )
Functions ¶
func EndsLike ¶
StartsLike build a string for like suffix '%' + s The default escape char is backslach '\\'.
func EscapeLike ¶
EscapeLike escape sql like string. The default escape char is backslach '\\'.
func EscapeString ¶
At present, this method only turns single-quotes into doubled single-quotes ( <code>"McHale's Navy"</code> => <code>"McHale”s Navy"</code>). It does not handle the cases of percent (%) or underscore (_) for use in LIKE clauses. </p> see http://www.jguru.com/faq/view.jsp?EID=8881
func QuoteDriver ¶ added in v1.0.15
QuoteDriver sets the Quoter for driverName to quoter.
func StartsLike ¶
StartsLike build a string for like prefix s + '%' The default escape char is backslach '\\'.
func StringLike ¶
StringLike build a string for like '%' + s + '%' The default escape char is backslach '\\'.
Types ¶
type QuoteMarks ¶ added in v1.0.15
type QuoteMarks []rune
type Quoter ¶ added in v1.0.15
type Quoter int
func GetQuoter ¶ added in v1.0.15
GetQuoteer returns the quoter for a given database given a drivername.
func (Quoter) Marks ¶ added in v1.0.15
func (quoter Quoter) Marks() QuoteMarks
type SqlReader ¶ added in v1.0.17
type SqlReader struct {
// contains filtered or unexported fields
}