Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Dec 5, 2024
1 parent ea50f91 commit c539324
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
* Marked as deprecated `ydb.MustParamsFromMap`
* Changed result `ydb.ParamsFromMap` result from tuple <`params.Parameters`, `error`> to `params.Parameters` only
* Changed result of experimental helper `ydb.ParamsFromMap` from tuple <`params.Parameters`, `error`> to `params.Parameters` only

## v3.93.1
* Published `query.ExecuteOption` as alias to `internal/query/options.Execute`
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ DECLARE $textArg AS Text;
DECLARE $intArg AS Int64;
SELECT $textArg AS TextField, $intArg AS IntField
`, query.WithParameters(ydb.MustParamsFromMap(map[string]any{
`, query.WithParameters(ydb.ParamsFromMap(map[string]any{
"$textArg": "asd",
"$intArg": int64(123),
})))
Expand Down
4 changes: 4 additions & 0 deletions internal/params/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ func (p *Params) String() string {
}

func (p *Params) ToYDB(a *allocator.Allocator) (map[string]*Ydb.TypedValue, error) {
if p == nil {
return nil, nil //nolint:nilnil
}

parameters := make(map[string]*Ydb.TypedValue, len(*p))
for _, param := range *p {
parameters[param.name] = value.ToYDB(param.value, a)
Expand Down

0 comments on commit c539324

Please sign in to comment.