/// <inheritdoc /> public override BigQueryInsertResults InsertRows(TableReference tableReference, IEnumerable <BigQueryInsertRow> rows, InsertOptions options = null) { var request = CreateInsertAllRequest(tableReference, rows, options, out IReadOnlyList <BigQueryInsertRow> validatedRows); if (validatedRows.Count == 0) { return(new BigQueryInsertResults(this, options, validatedRows, new TableDataInsertAllResponse())); } TableDataInsertAllResponse response = request.Execute(); BigQueryInsertResults results = new BigQueryInsertResults(this, options, validatedRows, response); return(results.ThrowIfNotSuppressing(options?.SuppressInsertErrors)); }
/// <inheritdoc /> public override async Task <BigQueryInsertResults> InsertRowsAsync(TableReference tableReference, IEnumerable <BigQueryInsertRow> rows, InsertOptions options = null, CancellationToken cancellationToken = default) { var request = CreateInsertAllRequest(tableReference, rows, options, out IReadOnlyList <BigQueryInsertRow> validatedRows); if (validatedRows.Count == 0) { return(new BigQueryInsertResults(this, options, validatedRows, new TableDataInsertAllResponse())); } var response = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false); BigQueryInsertResults results = new BigQueryInsertResults(this, options, validatedRows, response); return(results.ThrowIfNotSuppressing(options?.SuppressInsertErrors)); }