Jamdb.Sybase (jamdb_sybase v0.7.13)

Adapter module for Sybase. DBConnection behaviour implementation.

It uses jamdb_sybase for communicating to the database.

Link to this section Summary

Functions

Returns the configured JSON library.

Runs the SQL statement.

Starts and links to a database connection process.

Link to this section Functions

Specs

json_library() :: module()

Returns the configured JSON library.

To customize the JSON library, include the following in your config/config.exs:

config :jamdb_sybase, :json_library, SomeJSONModule

Defaults to Jason

Link to this function

query(conn, sql, params \\ [])

Specs

query(conn :: any(), sql :: any(), params :: any()) ::
  {:ok, any(), new_state :: any()}
  | {:error | :disconnect, any(), new_state :: any()}

Runs the SQL statement.

See DBConnection.prepare_execute/4.

In case of success, it must return an :ok tuple containing a map with at least two keys:

  • :num_rows - the number of rows affected
  • :rows - the result set as a list
Link to this function

start_link(opts)

Specs

start_link(opts :: Keyword.t()) :: {:ok, any()} | {:error, any()}

Starts and links to a database connection process.

See Ecto.Adapters.Jamdb.Sybase.

By default the DBConnection starts a pool with a single connection. The size of the pool can be increased with :pool_size. The ping interval to validate an idle connection can be given with the :idle_interval option.