Versions in this module Expand all Collapse all v1 v1.0.0 Feb 4, 2025 Changes in this version + const Binary + const Bit + const BitNum + const Blob + const Char + const Date + const Datetime + const Decimal + const Enum + const Expression + const Float32 + const Float64 + const Geometry + const HexNum + const HexVal + const Int16 + const Int24 + const Int32 + const Int64 + const Int8 + const Null + const ServerMoreResultsExists + const ServerPsOutParams + const ServerQueryWasSlow + const ServerSessionStateChanged + const ServerStatusAutocommit + const ServerStatusCursorExists + const ServerStatusDbDropped + const ServerStatusInTrans + const ServerStatusInTransReadonly + const ServerStatusLastRowSent + const ServerStatusMetadataChanged + const ServerStatusNoBackslashEscapes + const ServerStatusNoGoodIndexUsed + const ServerStatusNoIndexUsed + const Set + const Text + const Time + const Timestamp + const TimestampFormat + const TimestampFormatPrecision3 + const TimestampFormatPrecision6 + const Tuple + const TypeJSON + const Uint16 + const Uint24 + const Uint32 + const Uint64 + const Uint8 + const Unknown + const VarBinary + const VarChar + const Vector + const Year + var BvReplaceSchemaName = "__replacevtschemaname" + var BvSchemaName = "__vtschemaname" + var DontEscape = byte(255) + var ErrBadTupleEncoding = errors.New("bad tuple encoding in sqltypes.Value") + var ErrIncompatibleTypeCast = errors.New("Cannot convert value to desired type") + var ErrInvalidEncodedString = errors.New("invalid SQL encoded string") + var ErrNoSuchField = errors.New("No such field in RowNamedValues") + var NULL = Value + var NullBindVariable = &querypb.BindVariable + var NullBytes = []byte(NullStr) + var NullStr = "null" + var RandomGenerators = map[Type]RandomGenerator + var SQLDecodeMap [256]byte + var SQLEncodeMap [256]byte + func AreTypesEquivalent(mysqlTypeFromBinlog, mysqlTypeFromSchema querypb.Type) bool + func BindVariablesEqual(x, y map[string]*querypb.BindVariable) bool + func BitNumBindVariable(v []byte) *querypb.BindVariable + func BoolBindVariable(v bool) *querypb.BindVariable + func BufDecodeStringSQL(buf *strings.Builder, val string) error + func BufEncodeStringSQL(buf *strings.Builder, val string) + func BuildBindVariable(v any) (*querypb.BindVariable, error) + func BuildBindVariables(in map[string]any) (map[string]*querypb.BindVariable, error) + func BytesBindVariable(v []byte) *querypb.BindVariable + func CopyBindVariables(bindVariables map[string]*querypb.BindVariable) map[string]*querypb.BindVariable + func DecimalBindVariable(v DecimalString) *querypb.BindVariable + func DecodeStringSQL(val string) (string, error) + func EncodeStringSQL(val string) string + func EventTokenMinimum(ev1, ev2 *querypb.EventToken) *querypb.EventToken + func FieldsEqual(f1, f2 []*querypb.Field) bool + func Float64BindVariable(v float64) *querypb.BindVariable + func FormatBindVariables(bindVariables map[string]*querypb.BindVariable, full, asJSON bool) string + func HexNumBindVariable(v []byte) *querypb.BindVariable + func HexValBindVariable(v []byte) *querypb.BindVariable + func IncludeFieldsOrDefault(options *querypb.ExecuteOptions) querypb.ExecuteOptions_IncludedFields + func Int32BindVariable(v int32) *querypb.BindVariable + func Int64BindVariable(v int64) *querypb.BindVariable + func Int8BindVariable(v int8) *querypb.BindVariable + func IsBinary(t querypb.Type) bool + func IsDate(t querypb.Type) bool + func IsDateOrTime(t querypb.Type) bool + func IsDecimal(t querypb.Type) bool + func IsEnum(t querypb.Type) bool + func IsFloat(t querypb.Type) bool + func IsIntegral(t querypb.Type) bool + func IsNull(t querypb.Type) bool + func IsNumber(t querypb.Type) bool + func IsQuoted(t querypb.Type) bool + func IsSet(t querypb.Type) bool + func IsSigned(t querypb.Type) bool + func IsText(t querypb.Type) bool + func IsTextOrBinary(t querypb.Type) bool + func IsUnsigned(t querypb.Type) bool + func MakeTestFields(names, types string) []*querypb.Field + func MySQLToType(mysqlType byte, flags int64) (typ querypb.Type, err error) + func PrintResults(results []*Result) string + func Proto3QueryResponsesEqual(r1, r2 []*querypb.ResultWithError) bool + func Proto3ResultsEqual(r1, r2 []*querypb.QueryResult) bool + func Proto3ValuesEqual(v1, v2 []*querypb.Value) bool + func QueryResponsesEqual(r1, r2 []QueryResponse) bool + func QueryResponsesToProto3(qr []QueryResponse) []*querypb.ResultWithError + func ResultToProto3(qr *Result) *querypb.QueryResult + func ResultsEqual(r1, r2 []Result) bool + func ResultsEqualUnordered(r1, r2 []Result) bool + func ResultsToProto3(qr []Result) []*querypb.QueryResult + func RowEqual(want, got Row) bool + func RowToProto3(row []Value) *querypb.Row + func RowToProto3Inplace(row []Value, result *querypb.Row) int + func RowsEquals(want, got []Row) error + func RowsEqualsStr(wantStr string, got []Row) error + func RowsToProto3(rows [][]Value) []*querypb.Row + func StringBindVariable(v string) *querypb.BindVariable + func TestBindVariable(v any) *querypb.BindVariable + func TestRandomValues() (Value, Value) + func TupleToProto(v []Value) *querypb.Value + func TypeToMySQL(typ querypb.Type) (mysqlType byte, flags int64) + func Uint32BindVariable(v uint32) *querypb.BindVariable + func Uint64BindVariable(v uint64) *querypb.BindVariable + func ValidateBindVariable(bv *querypb.BindVariable) error + func ValidateBindVariables(bv map[string]*querypb.BindVariable) error + func ValueBindVariable(v Value) *querypb.BindVariable + func ValueToProto(v Value) *querypb.Value + type BinWriter interface + Write func([]byte) (int, error) + type DecimalString string + type NamedResult struct + Fields []*querypb.Field + InsertID uint64 + Rows []RowNamedValues + RowsAffected uint64 + func ToNamedResult(result *Result) (r *NamedResult) + func (r *NamedResult) Row() RowNamedValues + type QueryResponse struct + QueryError error + QueryResult *Result + func Proto3ToQueryReponses(qr []*querypb.ResultWithError) []QueryResponse + type RandomGenerator func() Value + type Result struct + Fields []*querypb.Field + Info string + InsertID uint64 + Rows []Row + RowsAffected uint64 + SessionStateChanges string + StatusFlags uint16 + func CustomProto3ToResult(fields []*querypb.Field, qr *querypb.QueryResult) *Result + func MakeTestResult(fields []*querypb.Field, rows ...string) *Result + func MakeTestStreamingResults(fields []*querypb.Field, rows ...string) []*Result + func MarshalResult(v any) (*Result, error) + func Proto3ToResult(qr *querypb.QueryResult) *Result + func Proto3ToResults(qr []*querypb.QueryResult) []Result + func ReplaceFields(result *Result, remap map[string]string) *Result + func (cached *Result) CachedSize(alloc bool) int64 + func (result *Result) AppendResult(src *Result) + func (result *Result) Copy() *Result + func (result *Result) Equal(other *Result) bool + func (result *Result) IsInTransaction() bool + func (result *Result) IsMoreResultsExists() bool + func (result *Result) Metadata() *Result + func (result *Result) Named() *NamedResult + func (result *Result) Repair(fields []*querypb.Field) + func (result *Result) ReplaceKeyspace(keyspace string) + func (result *Result) ShallowCopy() *Result + func (result *Result) StripMetadata(incl querypb.ExecuteOptions_IncludedFields) *Result + func (result *Result) Truncate(l int) *Result + type ResultMarshaller interface + MarshalResult func() (*Result, error) + type ResultStream interface + Recv func() (*Result, error) + type Row = []Value + func ParseRows(input string) ([]Row, error) + type RowMismatchError struct + func (e *RowMismatchError) Error() string + type RowNamedValues map[string]Value + func (r RowNamedValues) AsBool(fieldName string, def bool) bool + func (r RowNamedValues) AsBytes(fieldName string, def []byte) []byte + func (r RowNamedValues) AsFloat64(fieldName string, def float64) float64 + func (r RowNamedValues) AsInt32(fieldName string, def int32) int32 + func (r RowNamedValues) AsInt64(fieldName string, def int64) int64 + func (r RowNamedValues) AsString(fieldName string, def string) string + func (r RowNamedValues) AsUint64(fieldName string, def uint64) uint64 + func (r RowNamedValues) ToBool(fieldName string) (bool, error) + func (r RowNamedValues) ToBytes(fieldName string) ([]byte, error) + func (r RowNamedValues) ToFloat64(fieldName string) (float64, error) + func (r RowNamedValues) ToInt(fieldName string) (int, error) + func (r RowNamedValues) ToInt32(fieldName string) (int32, error) + func (r RowNamedValues) ToInt64(fieldName string) (int64, error) + func (r RowNamedValues) ToString(fieldName string) (string, error) + func (r RowNamedValues) ToUint64(fieldName string) (uint64, error) + type Type = querypb.Type + type Value struct + func BindVariableToValue(bv *querypb.BindVariable) (Value, error) + func Cast(v Value, typ Type) (Value, error) + func CopyRow(r []Value) []Value + func InterfaceToValue(goval any) (Value, error) + func MakeRowTrusted(fields []*querypb.Field, row *querypb.Row) []Value + func MakeTrusted(typ querypb.Type, val []byte) Value + func NewBitNum(v []byte) Value + func NewBoolean(v bool) Value + func NewDate(v string) Value + func NewDatetime(v string) Value + func NewDecimal(v string) Value + func NewFloat32(v float32) Value + func NewFloat64(v float64) Value + func NewHexNum(v []byte) Value + func NewHexVal(v []byte) Value + func NewInt16(v int16) Value + func NewInt32(v int32) Value + func NewInt64(v int64) Value + func NewInt8(v int8) Value + func NewIntegral(val string) (n Value, err error) + func NewJSON(v string) (Value, error) + func NewTime(v string) Value + func NewTimestamp(v string) Value + func NewUint16(v uint16) Value + func NewUint32(v uint32) Value + func NewUint64(v uint64) Value + func NewUint8(v uint8) Value + func NewValue(typ querypb.Type, val []byte) (v Value, err error) + func NewVarBinary(v string) Value + func NewVarChar(v string) Value + func ProtoToValue(v *querypb.Value) Value + func TestTuple(vals ...Value) Value + func TestValue(typ querypb.Type, val string) Value + func (cached *Value) CachedSize(alloc bool) int64 + func (v *Value) ForEachValue(each func(bv Value)) error + func (v *Value) IsComparable() bool + func (v *Value) SetTinyWeight(w uint32) + func (v *Value) UnmarshalJSON(b []byte) error + func (v Value) EncodeASCII(b BinWriter) + func (v Value) EncodeSQL(b BinWriter) + func (v Value) EncodeSQLBytes2(b *bytes2.Buffer) + func (v Value) EncodeSQLStringBuilder(b *strings.Builder) + func (v Value) Equal(other Value) bool + func (v Value) IsBinary() bool + func (v Value) IsDate() bool + func (v Value) IsDateTime() bool + func (v Value) IsDecimal() bool + func (v Value) IsEnum() bool + func (v Value) IsFloat() bool + func (v Value) IsIntegral() bool + func (v Value) IsNull() bool + func (v Value) IsQuoted() bool + func (v Value) IsSet() bool + func (v Value) IsSigned() bool + func (v Value) IsText() bool + func (v Value) IsTime() bool + func (v Value) IsTimestamp() bool + func (v Value) IsUnsigned() bool + func (v Value) Len() int + func (v Value) MarshalJSON() ([]byte, error) + func (v Value) Raw() []byte + func (v Value) RawStr() string + func (v Value) String() string + func (v Value) TinyWeight() uint32 + func (v Value) TinyWeightCmp(other Value) int + func (v Value) ToBool() (bool, error) + func (v Value) ToBytes() ([]byte, error) + func (v Value) ToCastInt64() (int64, error) + func (v Value) ToCastUint64() (uint64, error) + func (v Value) ToFloat64() (float64, error) + func (v Value) ToInt() (int, error) + func (v Value) ToInt32() (int32, error) + func (v Value) ToInt64() (int64, error) + func (v Value) ToString() string + func (v Value) ToUint16() (uint16, error) + func (v Value) ToUint32() (uint32, error) + func (v Value) ToUint64() (uint64, error) + func (v Value) Type() querypb.Type + type ValueMarshaller interface + MarshalSQL func(typ querypb.Type) ([]byte, error)