@@ -1012,6 +1012,7 @@ type (
10121012
10131013 readColumnsOption []string
10141014 readOrderedOption struct {}
1015+ readSnapshotOption bool
10151016 readKeyRangeOption KeyRange
10161017 readGreaterOrEqualOption struct { types.Value }
10171018 readLessOrEqualOption struct { types.Value }
@@ -1053,10 +1054,18 @@ func (columns readColumnsOption) ApplyReadTableOption(desc *ReadTableDesc, a *al
10531054 desc .Columns = append (desc .Columns , columns ... )
10541055}
10551056
1056- func (r readOrderedOption ) ApplyReadTableOption (desc * ReadTableDesc , a * allocator.Allocator ) {
1057+ func (readOrderedOption ) ApplyReadTableOption (desc * ReadTableDesc , a * allocator.Allocator ) {
10571058 desc .Ordered = true
10581059}
10591060
1061+ func (b readSnapshotOption ) ApplyReadTableOption (desc * ReadTableDesc , a * allocator.Allocator ) {
1062+ if b {
1063+ desc .UseSnapshot = FeatureEnabled .ToYDB ()
1064+ } else {
1065+ desc .UseSnapshot = FeatureDisabled .ToYDB ()
1066+ }
1067+ }
1068+
10601069func (x readKeyRangeOption ) ApplyReadTableOption (desc * ReadTableDesc , a * allocator.Allocator ) {
10611070 desc .initKeyRange ()
10621071 if x .From != nil {
@@ -1086,10 +1095,14 @@ func ReadColumns(names ...string) readColumnsOption {
10861095 return names
10871096}
10881097
1089- func ReadOrdered () readOrderedOption {
1098+ func ReadOrdered () ReadTableOption {
10901099 return readOrderedOption {}
10911100}
10921101
1102+ func ReadFromSnapshot (b bool ) ReadTableOption {
1103+ return readSnapshotOption (b )
1104+ }
1105+
10931106// ReadKeyRange returns ReadTableOption which makes ReadTable read values
10941107// in range [x.From, x.To).
10951108//
0 commit comments