Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
forest committed May 21, 2024
1 parent b9d4939 commit aecc161
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/avalanche.ex
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ defmodule Avalanche do
The `request_options` are merged with default options set with `default_options/1`.
"""
@spec run(String.t(), list(), keyword(), keyword()) :: any() | {:error, Avalanche.Error.t()}
@spec run(String.t(), list(), Keyword.t(), Keyword.t()) :: {:ok, Avalanche.Result.t()} | {:error, Avalanche.Error.t()}
def run(statement, params \\ [], run_options \\ [], request_options \\ []) do
start_time = System.monotonic_time()
metadata = %{params: params, query: statement}
Expand Down Expand Up @@ -190,7 +190,7 @@ defmodule Avalanche do
The `request_options` are merged with default options set with `default_options/1`.
"""
@spec status(String.t(), keyword(), keyword()) :: any() | {:error, Avalanche.Error.t()}
@spec status(String.t(), Keyword.t(), Keyword.t()) :: {:ok, Avalanche.Result.t()} | {:error, Avalanche.Error.t()}
def status(statement_handle, status_options \\ [], request_options \\ []) do
start_time = System.monotonic_time()

Expand Down Expand Up @@ -221,7 +221,7 @@ defmodule Avalanche do
See `default_options/1` for more information.
"""
@spec default_options() :: keyword()
@spec default_options() :: Keyword.t()
def default_options do
Application.get_env(:avalanche, :default_options, [])
end
Expand All @@ -233,7 +233,7 @@ defmodule Avalanche do
Avoid setting default options in libraries as they are global.
"""
@spec default_options(keyword()) :: :ok | {:error, Avalanche.Error.t()}
@spec default_options(Keyword.t()) :: :ok | {:error, Avalanche.Error.t()}
def default_options(options) do
with {:ok, opts} <- validate_options(options, @request_options_schema) do
Application.put_env(:avalanche, :default_options, opts)
Expand Down
6 changes: 3 additions & 3 deletions lib/avalanche/requests/statement_request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ defmodule Avalanche.StatementRequest do
path: String.t(),
headers: %{optional(binary()) => [binary()]},
body: body(),
token: String.t() | keyword(),
options: keyword()
token: String.t() | Keyword.t(),
options: Keyword.t()
}

@doc """
Builds a statement execution request to run.
"""
@spec build(String.t(), list(), keyword()) :: t()
@spec build(String.t(), list(), Keyword.t()) :: t()
def build(statement, params, options) do
bindings = Avalanche.Bindings.encode_params(params)

Expand Down
6 changes: 3 additions & 3 deletions lib/avalanche/requests/status_request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ defmodule Avalanche.StatusRequest do
url: url(),
path: String.t(),
headers: %{optional(binary()) => [binary()]},
token: String.t() | keyword(),
token: String.t() | Keyword.t(),
statement_handle: String.t(),
row_types: row_types(),
options: keyword()
options: Keyword.t()
}

@doc """
Builds a query status request to run.
"""
@spec build(String.t(), row_types(), keyword()) :: t()
@spec build(String.t(), row_types(), Keyword.t()) :: t()
def build(statement_handle, row_types \\ nil, options) do
{token_type, token} = Request.fetch_token(options)

Expand Down

0 comments on commit aecc161

Please sign in to comment.