コード例 #1
0
        public static ValueTask <IFdbDatabaseHandler> CreateDatabaseAsync(string?clusterFile, CancellationToken ct)
        {
            if (Fdb.GetMaxApiVersion() < 610)
            {             // Older version used a different way to create a database handle
                return(CreateDatabaseLegacyAsync(clusterFile, ct));
            }

            // Starting from 6.1, creating a database handler can be done directly
            var err = FdbNative.CreateDatabase(clusterFile, out var handle);

            if (Fdb.Failed(err))
            {
                throw Fdb.MapToException(err) !;
            }

            return(new ValueTask <IFdbDatabaseHandler>(new FdbNativeDatabase(handle, clusterFile)));
        }
コード例 #2
0
 public DatabaseHandle CreateDatabase(string databaseName)
 {
     FdbNative.CreateDatabase(databaseName, out d_handle);
     return(d_handle);
 }