Skip to content

Commit 74664e8

Browse files
committed
Support for fb_info_db_file_id (#941)
1 parent d3fd636 commit 74664e8

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbDatabaseInfoTests.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,15 @@ public void CompleteDatabaseInfoTest()
4242
.Where(x => !x.IsSpecialName)
4343
.Where(x => x.Name.EndsWith("Async")))
4444
{
45-
if (ServerVersion < new Version(4, 0, 0, 0) && new[] { "GetWireCryptAsync", "GetCryptPluginAsync", "GetNextAttachmentAsync", "GetNextStatementAsync", "GetReplicaModeAsync" }.Contains(m.Name))
45+
if (ServerVersion < new Version(4, 0, 0, 0)
46+
&& new[] {
47+
nameof(FbDatabaseInfo.GetWireCryptAsync),
48+
nameof(FbDatabaseInfo.GetCryptPluginAsync),
49+
nameof(FbDatabaseInfo.GetNextAttachmentAsync),
50+
nameof(FbDatabaseInfo.GetNextStatementAsync),
51+
nameof(FbDatabaseInfo.GetReplicaModeAsync),
52+
nameof(FbDatabaseInfo.GetDbFileIdAsync)
53+
}.Contains(m.Name))
4654
continue;
4755

4856
Assert.DoesNotThrowAsync(() => (Task)m.Invoke(dbInfo, new object[] { CancellationToken.None }), m.Name);

Provider/src/FirebirdSql.Data.FirebirdClient/Common/IscHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public static List<object> ParseDatabaseInfo(byte[] buffer)
8888

8989
case IscCodes.fb_info_wire_crypt:
9090
case IscCodes.fb_info_crypt_plugin:
91+
case IscCodes.fb_info_db_file_id:
9192
info.Add(Encoding2.Default.GetString(buffer, pos, length));
9293
break;
9394

Provider/src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbDatabaseInfo.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,15 @@ public Task<string> GetReplicaModeAsync(CancellationToken cancellationToken = de
422422
return GetValueAsync<string>(IscCodes.fb_info_replica_mode, cancellationToken);
423423
}
424424

425+
public string GetDbFileId()
426+
{
427+
return GetValue<string>(IscCodes.fb_info_db_file_id);
428+
}
429+
public Task<string> GetDbFileIdAsync(CancellationToken cancellationToken = default)
430+
{
431+
return GetValueAsync<string>(IscCodes.fb_info_db_file_id, cancellationToken);
432+
}
433+
425434
#endregion
426435

427436
#region Constructors

0 commit comments

Comments
 (0)