View Source Tds.Protocol (Tds v2.3.1)
Implements DBConnection behaviour for TDS protocol.
Link to this section Summary
Functions
Callback implementation for DBConnection.checkout/1
.
Callback implementation for DBConnection.connect/1
.
Callback implementation for DBConnection.disconnect/2
.
Callback implementation for DBConnection.handle_begin/2
.
Callback implementation for DBConnection.handle_close/3
.
Callback implementation for DBConnection.handle_commit/2
.
Callback implementation for DBConnection.handle_deallocate/4
.
Callback implementation for DBConnection.handle_declare/4
.
Callback implementation for DBConnection.handle_execute/4
.
Callback implementation for DBConnection.handle_fetch/4
.
Callback implementation for DBConnection.handle_prepare/3
.
Callback implementation for DBConnection.handle_rollback/2
.
Callback implementation for DBConnection.handle_status/2
.
Callback implementation for DBConnection.ping/1
.
Link to this section Types
Specs
env() :: %{ trans: <<_::8>>, savepoint: non_neg_integer(), collation: Tds.Protocol.Collation.t(), packetsize: integer() }
Specs
packet_data() :: binary()
Specs
sock() :: {:gen_tcp | :ssl, :gen_tcp.socket() | :ssl.sslsocket()}
Specs
state() :: :ready | :prelogin | :login | :prepare | :executing
Specs
Specs
transaction() :: nil | :started | :successful | :failed
Link to this section Functions
Specs
checkin(state :: t()) :: {:ok, new_state :: t()} | {:disconnect, Exception.t(), new_state :: t()}
Specs
checkout(state :: t()) :: {:ok, new_state :: any()} | {:disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.checkout/1
.
Specs
connect(opts :: Keyword.t()) :: {:ok, state :: t()} | {:error, Exception.t()}
Callback implementation for DBConnection.connect/1
.
Specs
disconnect(err :: Exception.t() | String.t(), state :: t()) :: :ok
Callback implementation for DBConnection.disconnect/2
.
Specs
handle_begin(Keyword.t(), t()) :: {:ok, Tds.Result.t(), new_state :: t()} | {DBConnection.status(), new_state :: t()} | {:disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.handle_begin/2
.
Specs
handle_close(Tds.Query.t(), nil | keyword() | map(), t()) :: {:ok, Tds.Result.t(), new_state :: t()} | {:error | :disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.handle_close/3
.
Specs
handle_commit(Keyword.t(), t()) :: {:ok, Tds.Result.t(), new_state :: t()} | {DBConnection.status(), new_state :: t()} | {:disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.handle_commit/2
.
Specs
handle_deallocate( query :: Tds.Query.t(), cursor :: any(), opts :: Keyword.t(), state :: t() ) :: {:ok, Tds.Result.t(), new_state :: t()} | {:error | :disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.handle_deallocate/4
.
Specs
handle_declare( Tds.Query.t(), params :: any(), opts :: Keyword.t(), state :: t() ) :: {:ok, Tds.Query.t(), cursor :: any(), new_state :: t()} | {:error | :disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.handle_declare/4
.
Specs
handle_execute(Tds.Query.t(), DBConnection.params(), Keyword.t(), t()) :: {:ok, Tds.Query.t(), Tds.Result.t(), new_state :: t()} | {:error | :disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.handle_execute/4
.
Specs
handle_fetch( Tds.Query.t(), cursor :: any(), opts :: Keyword.t(), state :: t() ) :: {:cont | :halt, Tds.Result.t(), new_state :: t()} | {:error | :disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.handle_fetch/4
.
Specs
handle_prepare(Tds.Query.t(), Keyword.t(), t()) :: {:ok, Tds.Query.t(), new_state :: t()} | {:error | :disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.handle_prepare/3
.
Specs
handle_rollback(Keyword.t(), t()) :: {:ok, Tds.Result.t(), new_state :: t()} | {:idle, new_state :: t()} | {:disconnect, Exception.t(), new_state :: t()}
Callback implementation for DBConnection.handle_rollback/2
.
Specs
handle_status(Keyword.t(), t()) :: {:idle | :transaction | :error, t()} | {:disconnect, Exception.t(), t()}
Callback implementation for DBConnection.handle_status/2
.
Specs
ping(t()) :: {:ok, t()} | {:disconnect, Exception.t(), t()}
Callback implementation for DBConnection.ping/1
.