Snowflex.Transport behaviour (Snowflex v1.2.1)
View SourceBehaviour module that defines the interface for Snowflake transport implementations.
See Snowflex.Transport.Http for the default implementation.
Summary
Callbacks
Clean up cursor state after streaming is complete. See DBConnection.handle_deallocate/4 for more information.
Declare a statement (primarily for streaming). See DBConnection.handle_declare/4 for more information.
Disconnect from the database. See DBConnection.handle_close/3 for more information.
Execute a statement. See DBConnection.handle_execute/4 for more information.
Fetch the next result from a cursor. See DBConnection.handle_fetch/4 for more information.
Periodic pings to the server, default is once per second. See DBConnection.ping/1 for more information.
Types
@type connection_opts() :: Keyword.t()
@type query_result() :: {:ok, Snowflex.Result.t()} | {:error, Snowflex.Error.t()}
Callbacks
@callback deallocate(pid()) :: :ok
Clean up cursor state after streaming is complete. See DBConnection.handle_deallocate/4 for more information.
@callback declare(pid(), String.t(), any(), Keyword.t()) :: query_result()
Declare a statement (primarily for streaming). See DBConnection.handle_declare/4 for more information.
@callback disconnect(pid()) :: :ok
Disconnect from the database. See DBConnection.handle_close/3 for more information.
@callback execute_statement(pid(), String.t(), any(), Keyword.t()) :: query_result()
Execute a statement. See DBConnection.handle_execute/4 for more information.
@callback fetch(pid(), String.t(), Keyword.t()) :: query_result()
Fetch the next result from a cursor. See DBConnection.handle_fetch/4 for more information.
@callback ping(pid()) :: query_result()
Periodic pings to the server, default is once per second. See DBConnection.ping/1 for more information.
@callback start_link(connection_opts()) :: GenServer.on_start()