github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/query/result.go (about) 1 package query 2 3 import ( 4 "context" 5 6 "github.com/ydb-platform/ydb-go-sdk/v3/internal/closer" 7 "github.com/ydb-platform/ydb-go-sdk/v3/internal/query/scanner" 8 ) 9 10 type ( 11 Result interface { 12 closer.Closer 13 14 NextResultSet(ctx context.Context) (ResultSet, error) 15 Err() error 16 } 17 ResultSet interface { 18 NextRow(ctx context.Context) (Row, error) 19 } 20 Row interface { 21 Scan(dst ...interface{}) error 22 ScanNamed(dst ...scanner.NamedDestination) error 23 ScanStruct(dst interface{}, opts ...scanner.ScanStructOption) error 24 } 25 ) 26 27 func Named(columnName string, destinationValueReference interface{}) (dst scanner.NamedDestination) { 28 return scanner.NamedRef(columnName, destinationValueReference) 29 } 30 31 func WithScanStructTagName(name string) scanner.ScanStructOption { 32 return scanner.WithTagName(name) 33 } 34 35 func WithScanStructAllowMissingColumnsFromSelect() scanner.ScanStructOption { 36 return scanner.WithAllowMissingColumnsFromSelect() 37 } 38 39 func WithScanStructAllowMissingFieldsInStruct() scanner.ScanStructOption { 40 return scanner.WithAllowMissingFieldsInStruct() 41 }