示例#1
0
        protected override async Task <SqlDriver> CreateDriverAsync(
            string connectionString, SqlDriverConfiguration configuration, CancellationToken token)
        {
            var connection = new FbConnection(connectionString);

            await using (connection.ConfigureAwait(false)) {
                await connection.OpenAsync(token).ConfigureAwait(false);

                await SqlHelper.ExecuteInitializationSqlAsync(connection, configuration, token).ConfigureAwait(false);

                var defaultSchema = await GetDefaultSchemaAsync(connection, token : token).ConfigureAwait(false);

                return(CreateDriverInstance(
                           connectionString, GetVersionFromServerVersionString(connection.ServerVersion), defaultSchema));
            }
        }
        protected override async Task <SqlDriver> CreateDriverAsync(
            string connectionString, SqlDriverConfiguration configuration, CancellationToken token)
        {
            var connection = new FbConnection(connectionString);

            await using (connection.ConfigureAwait(false)) {
                if (configuration.DbConnectionAccessors.Count > 0)
                {
                    await OpenConnectionWithNotification(connection, configuration, true, token).ConfigureAwait(false);
                }
                else
                {
                    await OpenConnectionFast(connection, configuration, true, token).ConfigureAwait(false);
                }
                var defaultSchema = await GetDefaultSchemaAsync(connection, token : token).ConfigureAwait(false);

                return(CreateDriverInstance(
                           connectionString, GetVersionFromServerVersionString(connection.ServerVersion), defaultSchema));
            }
        }