/// <inheritdoc /> public override BigQueryResults ExecuteQuery(string sql, ExecuteQueryOptions options = null) { GaxPreconditions.CheckNotNull(sql, nameof(sql)); var queryRequest = new QueryRequest { Query = sql, UseLegacySql = false }; options?.ModifyRequest(queryRequest); var request = Service.Jobs.Query(queryRequest, ProjectId); var queryResponse = request.Execute(); return(new BigQueryResults(this, queryResponse, options)); }
/// <inheritdoc /> public override async Task <BigQueryResults> ExecuteQueryAsync(string sql, ExecuteQueryOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { GaxPreconditions.CheckNotNull(sql, nameof(sql)); var queryRequest = new QueryRequest { Query = sql, UseLegacySql = false }; options?.ModifyRequest(queryRequest); var request = Service.Jobs.Query(queryRequest, ProjectId); var queryResponse = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false); return(new BigQueryResults(this, queryResponse, options)); }
/// <inheritdoc /> public override BigQueryResults ExecuteQuery(BigQueryCommand command, ExecuteQueryOptions options = null) { GaxPreconditions.CheckNotNull(command, nameof(command)); var queryRequest = new QueryRequest { UseLegacySql = false }; command.PopulateQueryRequest(queryRequest); options?.ModifyRequest(queryRequest); var request = Service.Jobs.Query(queryRequest, ProjectId); var queryResponse = request.Execute(); return(new BigQueryResults(this, queryResponse, options)); }
/// <inheritdoc /> public override async Task <BigQueryResults> ExecuteQueryAsync(BigQueryCommand command, ExecuteQueryOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { GaxPreconditions.CheckNotNull(command, nameof(command)); var queryRequest = new QueryRequest { UseLegacySql = false }; command.PopulateQueryRequest(queryRequest); options?.ModifyRequest(queryRequest); var request = Service.Jobs.Query(queryRequest, ProjectId); request.ModifyRequest += _versionHeaderAction; var queryResponse = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false); return(new BigQueryResults(this, queryResponse, options)); }
internal BigQueryResults(BigQueryClient client, QueryResponse response, ExecuteQueryOptions options) : this(client, ConvertQueryResponse(GaxPreconditions.CheckNotNull(response, nameof(response))), options?.ToGetQueryResultsOptions()) { }
/// <summary> /// Executes a command. This overload allows query parameterization, and is preferred over /// <see cref="ExecuteQuery(string, ExecuteQueryOptions)"/> when values need to be passed in. /// </summary> /// <param name="command">The command to execute. Must not be null.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <returns>The result of the query.</returns> public virtual BigQueryResults ExecuteQuery(BigQueryCommand command, ExecuteQueryOptions options = null) { throw new NotImplementedException(); }
/// <summary> /// Executes a query. /// </summary> /// <param name="sql">The SQL query. Must not be null.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <returns>The result of the query.</returns> public virtual BigQueryResults ExecuteQuery(string sql, ExecuteQueryOptions options = null) { throw new NotImplementedException(); }
/// <summary> /// Asynchronously executes a command. This overload allows query parameterization, and is preferred over /// <see cref="ExecuteQueryAsync(string, ExecuteQueryOptions,CancellationToken)"/> when values need to be passed in. /// </summary> /// <param name="command">The command to execute. Must not be null.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>A task representing the asynchronous operation. When complete, the result is /// the <see cref="BigQueryResults"/> representing the query.</returns> public virtual Task <BigQueryResults> ExecuteQueryAsync(BigQueryCommand command, ExecuteQueryOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { throw new NotImplementedException(); }