func Serial(v interface{}) (string, error) {
	switch x := v.(type) {
	case nil:
		return "", UnsupportedArgError{"<nil>"}
	case int8:
		return strconv.Itoa(int(x)), nil
	case int16:
		return strconv.Itoa(int(x)), nil
	case int32:
		return strconv.Itoa(int(x)), nil
	case int:
		return strconv.Itoa(x), nil
	case uint16:
		return strconv.Itoa(int(x)), nil
	case int64:
		return strconv.FormatInt(x, 10), nil
	case uint32:
		return strconv.FormatUint(uint64(x), 10), nil
	case uint:
		return strconv.FormatUint(uint64(x), 10), nil
	case uint64:
		return strconv.FormatUint(x, 10), nil
	case float32:
		return "", UnsupportedArgError{"float32"}
	case float64:
		return "", UnsupportedArgError{"float64"}
	case Numeric:
		if _, err := strconv.ParseFloat(string(x), 64); err != nil {
			return "", err
		}
		return string(x), nil
	case byte:
		return "", UnsupportedArgError{"byte/uint8"}
	case bool:
		return strconv.FormatBool(x), nil
	case string:
		return "'" + strings.Replace(x, "'", "''", -1) + "'", nil
	case []byte:
		return "", UnsupportedArgError{"[]byte"}
	case time.Time:
		return "", UnsupportedArgError{"time.Time"}
	case time.Duration:
		return "", UnsupportedArgError{"time.Duration"}
	case json.RawMessage:
		return "", UnsupportedArgError{"json.RawMessage"}
	}
	if reflect.TypeOf(v).Kind() == reflect.Slice {
		x := reflect.ValueOf(v)
		if x.IsNil() {
			return "", UnsupportedArgError{"[]<nil>"}
		}
		slice := make([]interface{}, x.Len())
		for i := 0; i < x.Len(); i++ {
			slice[i] = x.Index(i).Interface()
		}
		return serialSlice(slice)
	}
	if reflect.TypeOf(v).Kind() == reflect.Map {
		return "", UnsupportedArgError{"map"}
	}
	return "", UnsupportedArgError{fmt.Sprintf("%T", v)}
}
Serial converts any supported value to its equivalent string for as a Trino parameter
See https://trino.io/docs/current/language/types.html
package trino
import (
	"encoding/json"
	"fmt"
	"reflect"
	"strconv"
	"strings"
	"time"
)
type UnsupportedArgError struct {
	t string
}
func (e UnsupportedArgError) Error() string {
	return fmt.Sprintf("trino: unsupported arg type: %s", e.t)
}
type Numeric string