Skip to content

Commit 9728cac

Browse files
committed
Support for isc_info_creation_date (#990).
1 parent 94128e0 commit 9728cac

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ public static List<object> ParseDatabaseInfo(byte[] buffer)
130130
}
131131
break;
132132

133+
case IscCodes.isc_info_creation_date:
134+
var date = TypeDecoder.DecodeDate((int)VaxInteger(buffer, pos, 4));
135+
var time = TypeDecoder.DecodeTime((int)VaxInteger(buffer, pos + 4, 4));
136+
info.Add(date.Add(time));
137+
break;
138+
133139
default:
134140
throw new ArgumentOutOfRangeException(nameof(type), $"{nameof(type)}={type}");
135141
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,15 @@ public Task<string> GetCryptPluginAsync(CancellationToken cancellationToken = de
386386
return GetValueAsync<string>(IscCodes.fb_info_crypt_plugin, cancellationToken);
387387
}
388388

389+
public DateTime GetCreationDate()
390+
{
391+
return GetValue<DateTime>(IscCodes.isc_info_creation_date);
392+
}
393+
public Task<DateTime> GetCreationDateAsync(CancellationToken cancellationToken = default)
394+
{
395+
return GetValueAsync<DateTime>(IscCodes.isc_info_creation_date, cancellationToken);
396+
}
397+
389398
#endregion
390399

391400
#region Constructors

0 commit comments

Comments
 (0)