Skip to content

Commit

Permalink
feat(bigquery): parametrise location
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronsa committed Jan 16, 2019
1 parent a752065 commit 53a1a32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/big_query.ml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ module Jobs = struct

let string (str : string) = Ok str

let query ?project_id ?(use_legacy_sql=false) ?(params = []) q : (query_response, [> Error.t ]) Lwt_result.t =
let query ?project_id ?(use_legacy_sql=false) ?(params = []) ?(location = "EU") q : (query_response, [> Error.t ]) Lwt_result.t =
let parameter_mode =
if use_legacy_sql || params = [] then
None
Expand All @@ -449,7 +449,7 @@ module Jobs = struct
{ kind = "bigquery#queryRequest"
; query = q
; use_legacy_sql = use_legacy_sql
; location = "EU"
; location
; parameter_mode = parameter_mode
; query_parameters = params
}
Expand Down
2 changes: 1 addition & 1 deletion src/big_query.mli
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module Jobs : sig

val query_response_to_yojson : query_response -> Yojson.Safe.json

val query : ?project_id:string -> ?use_legacy_sql:bool -> ?params:Param.query_parameter list -> string -> (query_response, [> Error.t ]) Lwt_result.t
val query : ?project_id:string -> ?use_legacy_sql:bool -> ?params:Param.query_parameter list -> ?location:string -> string -> (query_response, [> Error.t ]) Lwt_result.t
val get_query_results : ?page_token:string -> job_reference -> (query_response, [> Error.t ]) Lwt_result.t

(** Type of query responses, when the job is complete and we definitely have some data. *)
Expand Down

0 comments on commit 53a1a32

Please sign in to comment.