ydb-go-sdk icon indicating copy to clipboard operation
ydb-go-sdk copied to clipboard

Variant().Struct()

Open asmyasnikov opened this issue 1 year ago • 1 comments

Next code must be worked:

params := ydb.ParamsBuilder().Param("$param").Variant().Struct().
     Field("col1").Text("text").
     Field("col2").Uint32(123).
     Field("col3").Int64(456).
     Build().
     Build().
     Build()

Variable params can be used in

err := db.Table().Do(ctx, func(ctx, s) error) {
    res, tx, err := s.Execute(ctx, txControl, `
        -- DECLARE $param AS Variant<Struct<col1:Text,col2:Uin32,col3:Int64>>;
        SELECT $param;
    `, params)
    . . .
})

See ydb.Builder().Param("$name").List() as example

asmyasnikov avatar Feb 28 '24 12:02 asmyasnikov

i get in this task

size12 avatar Mar 27 '24 17:03 size12