utils

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AllowMapSQLScript = "set allow_experimental_map_type = 1"

Variables

This section is empty.

Functions

func FormatCount

func FormatCount(count int64) string

func IsInsert

func IsInsert(query string) bool

func MakeColumnValues

func MakeColumnValues(nColumns int, blockSize int) [][]interface{}

func NewMatcher

func NewMatcher(needle string) *wordMatcher

NewMatcher returns matcher for word needle

func NumArgs

func NumArgs(query string) int

NumArgs returns the number of arguments in a sql query Arguments are denoted by '?'

func ParamParser

func ParamParser(reader *bytes.Reader) string

func SkipIntegrationTestIfShort

func SkipIntegrationTestIfShort(t *testing.T)

func TransposeMatrix

func TransposeMatrix(table [][]interface{}) [][]interface{}

todo: this might be slow, think of another way to "tranpose" TransposeMatrix row values to column values

Types

type InsertQuery

type InsertQuery struct {
	DataFmt string
	Query   string
	Values  string
}

InsertQuery is a insert Query disected e.g. INSERT INTO table VALUES (1); becomes

{
  DataFmt: "VALUES",
  Query: "INSERT INTO table VALUES",
  Values: "(1)"
}

func ParseInsertQuery

func ParseInsertQuery(query string) (*InsertQuery, error)

Jump to

Keyboard shortcuts

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