Move from gocql/gocql to scylladb/gocql

This commit is contained in:
Dmitry Kropachev
2024-06-16 08:40:32 -04:00
committed by Sylwia Szunejko
parent ab80d70106
commit 207ba8723e
6 changed files with 41 additions and 42 deletions

View File

@@ -1,12 +1,9 @@
package main
import (
"fmt"
"regexp"
"strconv"
"strings"
"github.com/gocql/gocql"
)
var types = map[string]string{
@@ -88,18 +85,3 @@ func mapScyllaToGoType(s string) string {
return camelize(s) + "UserType"
}
func typeToString(t interface{}) string {
tType := fmt.Sprintf("%T", t)
switch tType {
case "gocql.NativeType":
return t.(gocql.NativeType).String()
case "gocql.CollectionType":
collectionType := t.(gocql.CollectionType).String()
collectionType = strings.ReplaceAll(collectionType, "(", "<")
collectionType = strings.ReplaceAll(collectionType, ")", ">")
return collectionType
default:
panic(fmt.Sprintf("Did not expect %v type in user defined type", tType))
}
}