File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1+ * Added fluent modifiers for ` options.TimeToLiveSettings `
2+
13## v3.40.0
24* Added ` options.WithAddAttribute ` and ` options.WithDropAttribute ` options for ` session.AlterTable ` request
35* Added ` options.WithAddIndex ` and ` options.WithDropIndex ` options for ` session.AlterTable ` request
810* Added ` NestedCall ` field to retry trace start infos for alarm on nested calls
911* Added ` topicoptions.WithWriterTrace ` option for attach tracer into separated writer
1012* Added ` sugar.IsTableExists() ` helper for check existence of table
11- * Added ` types.AlterTable ` options FIXME
1213
1314## v3.39.0
1415* Removed message level partitioning from experimental topic API. It is unavailable on server side yet.
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ func Example_alterTable() {
162162 options .WithSetTimeToLiveSettings (options.TimeToLiveSettings {
163163 ColumnName : "expire_at" ,
164164 ExpireAfterSeconds : uint32 (time .Hour .Seconds ()),
165- }),
165+ }. WithMode ( options . TimeToLiveModeValueSinceUnixEpoch ). WithColumnUnit ( options . TimeToLiveUnitSeconds ) ),
166166 options .WithAddIndex ("idx_series_series_id" ,
167167 options .WithIndexColumns ("series_id" ),
168168 options .WithDataColumns ("title" ),
Original file line number Diff line number Diff line change @@ -442,6 +442,26 @@ const (
442442 TimeToLiveModeValueSinceUnixEpoch
443443)
444444
445+ func (ttl TimeToLiveSettings ) WithColumnName (columnName string ) TimeToLiveSettings {
446+ ttl .ColumnName = columnName
447+ return ttl
448+ }
449+
450+ func (ttl TimeToLiveSettings ) WithExpireAfter (expireAfter time.Duration ) TimeToLiveSettings {
451+ ttl .ExpireAfterSeconds = uint32 (expireAfter .Seconds ())
452+ return ttl
453+ }
454+
455+ func (ttl TimeToLiveSettings ) WithMode (mode TimeToLiveMode ) TimeToLiveSettings {
456+ ttl .Mode = mode
457+ return ttl
458+ }
459+
460+ func (ttl TimeToLiveSettings ) WithColumnUnit (columnUnit TimeToLiveUnit ) TimeToLiveSettings {
461+ ttl .ColumnUnit = & columnUnit
462+ return ttl
463+ }
464+
445465func (ttl * TimeToLiveSettings ) ToYDB () * Ydb_Table.TtlSettings {
446466 if ttl == nil {
447467 return nil
You can’t perform that action at this time.
0 commit comments