Skip to content

Commit 80b3ff5

Browse files
committed
Statistics to nullable and IncludeStatistics removed
To perform a backup or restore without determining the statistics values, the `Statistics` property can be set to `null`. The property `IncludeStatistics` is therefore no longer required.
1 parent b492cce commit 80b3ff5

File tree

1 file changed

+5
-6
lines changed
  • src/FirebirdSql.Data.FirebirdClient/Services

1 file changed

+5
-6
lines changed

src/FirebirdSql.Data.FirebirdClient/Services/FbBackup.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ public sealed class FbBackup : FbService
3232
public int Factor { get; set; }
3333
public string SkipData { get; set; }
3434
public FbBackupFlags Options { get; set; }
35-
public bool IncludeStatistics { get; set; } = true;
36-
public FbBackupRestoreStatistics Statistics { get; set; }
35+
public FbBackupRestoreStatistics? Statistics { get; set; } = default(FbBackupRestoreStatistics);
3736

3837
public FbBackup(string connectionString = null)
3938
: base(connectionString)
@@ -68,8 +67,8 @@ public void Execute()
6867
if (!string.IsNullOrEmpty(SkipData))
6968
startSpb.Append2(IscCodes.isc_spb_bkp_skip_data, SkipData);
7069
startSpb.Append(IscCodes.isc_spb_options, (int)Options);
71-
if (IncludeStatistics)
72-
startSpb.Append2(IscCodes.isc_spb_bkp_stat, Statistics.BuildConfiguration());
70+
if (Statistics.HasValue)
71+
startSpb.Append2(IscCodes.isc_spb_bkp_stat, Statistics.Value.BuildConfiguration());
7372
if (ConnectionStringOptions.ParallelWorkers > 0)
7473
startSpb.Append(IscCodes.isc_spb_bkp_parallel_workers, ConnectionStringOptions.ParallelWorkers);
7574
StartTask(startSpb);
@@ -115,8 +114,8 @@ public async Task ExecuteAsync(CancellationToken cancellationToken = default)
115114
if (!string.IsNullOrEmpty(SkipData))
116115
startSpb.Append2(IscCodes.isc_spb_bkp_skip_data, SkipData);
117116
startSpb.Append(IscCodes.isc_spb_options, (int)Options);
118-
if (IncludeStatistics)
119-
startSpb.Append2(IscCodes.isc_spb_bkp_stat, Statistics.BuildConfiguration());
117+
if (Statistics.HasValue)
118+
startSpb.Append2(IscCodes.isc_spb_bkp_stat, Statistics.Value.BuildConfiguration());
120119
if (ConnectionStringOptions.ParallelWorkers > 0)
121120
startSpb.Append(IscCodes.isc_spb_bkp_parallel_workers, ConnectionStringOptions.ParallelWorkers);
122121
await StartTaskAsync(startSpb, cancellationToken).ConfigureAwait(false);

0 commit comments

Comments
 (0)