sqx

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 5 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndsLike

func EndsLike(s string, escape ...rune) string

StartsLike build a string for like suffix '%' + s The default escape char is backslach '\\'.

func EscapeLike

func EscapeLike(s string, escape ...rune) string

EscapeLike escape sql like string. The default escape char is backslach '\\'.

func EscapeString

func EscapeString(s string) string

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 Quote

func Quote(s string, q string) string

Quote quote string 's' with quote string 'q', return (q + s + q)

func QuoteFunc

func QuoteFunc(q string) func(string) string

QuoteFunc return a quote function with quote string 'q'

func StartsLike

func StartsLike(s string, escape ...rune) string

StartsLike build a string for like prefix s + '%' The default escape char is backslach '\\'.

func StringLike

func StringLike(s string, escape ...rune) string

StringLike build a string for like '%' + s + '%' The default escape char is backslach '\\'.

Types

type Vector

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

Vector is a wrapper for []float64 to implement sql.Scanner and driver.Valuer.

func NewVector

func NewVector(vec []float64) Vector

NewVector creates a new Vector from a slice of float64.

func (*Vector) Parse

func (v *Vector) Parse(s string) error

Parse parses a string representation of a vector.

func (*Vector) Scan

func (v *Vector) Scan(src interface{}) (err error)

Scan implements the sql.Scanner interface.

func (Vector) Slice

func (v Vector) Slice() []float64

Slice returns the underlying slice of float64.

func (Vector) String

func (v Vector) String() string

String returns a string representation of the vector.

func (Vector) Value

func (v Vector) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

Jump to

Keyboard shortcuts

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