Skip to content

Commit

Permalink
uint64 conversion for .hash
Browse files Browse the repository at this point in the history
  • Loading branch information
zinal committed May 2, 2024
1 parent eb17977 commit f61628f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/storage/ydb.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const (
jsonType = "Json"
jsonDocumentType = "JsonDocument"
timestampType = "Timestamp"
uint64Type = "Uint64"
)

func (s *YDB) resolveFieldMapping(ctx context.Context) error {
Expand Down Expand Up @@ -192,6 +193,13 @@ func type2Type(t types.Type, v interface{}) (types.Value, int, error) {
default:
return nil, -1, fmt.Errorf("not supported conversion (string) from '%s' to '%s' (%s)", v, columnTypeYql, t)
}
case uint64:
switch columnTypeYql {
case uint64Type:
return convertValueIfOptional(optional, types.Uint64Value(v)), Sz8 + Sz8, nil
default:
return nil, -1, fmt.Errorf("not supported conversion (uint64) from '%v' to '%s' (%s)", v, columnTypeYql, t)
}
case map[interface{}]interface{}:
j, err := json.Marshal(convertByteFieldsToString(v))
if err != nil {
Expand Down

0 comments on commit f61628f

Please sign in to comment.