@@ -40,7 +40,10 @@ func TestKeyValue(t *testing.T) {
4040
4141 // get
4242 err = driver .Table ().Do (scope .Ctx , func (ctx context.Context , s table.Session ) error {
43- rows , err := s .ReadRows (ctx , tablePath , types .ListValue (types .Int64Value (id )),
43+ rows , err := s .ReadRows (ctx , tablePath ,
44+ types .ListValue (types .StructValue (
45+ types .StructFieldValue ("id" , types .Int64Value (id )),
46+ )),
4447 options .ReadColumn ("val" ),
4548 )
4649 if err != nil {
@@ -49,10 +52,10 @@ func TestKeyValue(t *testing.T) {
4952 defer func () {
5053 _ = rows .Close ()
5154 }()
52- if ! rows .HasNextResultSet ( ) {
55+ if ! rows .NextResultSet ( ctx ) {
5356 return fmt .Errorf ("no result sets" )
5457 }
55- if ! rows .HasNextRow () {
58+ if ! rows .NextRow () {
5659 return fmt .Errorf ("no rows" )
5760 }
5861 if rows .CurrentResultSet ().RowCount () != 1 {
@@ -61,10 +64,11 @@ func TestKeyValue(t *testing.T) {
6164 if rows .CurrentResultSet ().ColumnCount () != 1 {
6265 return fmt .Errorf ("wrong column count (%d)" , rows .CurrentResultSet ().ColumnCount ())
6366 }
64- var actualValue int64
65- if err := rows .ScanNamed (named .Optional ("val" , & actualValue )); err != nil {
67+ var actualValue string
68+ if err := rows .ScanNamed (named .OptionalWithDefault ("val" , & actualValue )); err != nil {
6669 return err
6770 }
71+ t .Logf ("%s[%d] = %q" , tablePath , id , actualValue )
6872 return rows .Err ()
6973 })
7074 scope .Require .NoError (err )
0 commit comments