squ

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndsLike

func EndsLike(s string) string

StartsLike build a string for like suffix '%' + s

func EscapeLike

func EscapeLike(s string) string

EscapeLike escape sql like string

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

StartsLike build a string for like prefix s + '%'

func StringLike

func StringLike(s string) string

StringLike build a string for like '%' + s + '%'

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