View Source EctoMySQLExtras behaviour (Ecto MySQL Extras v0.6.2)

Documentation for EctoMySQLExtras.

Summary

Types

@type repo() :: module() | {module(), node()}

Callbacks

@callback info() :: %{
  :title => String.t(),
  :columns => [%{name: atom(), type: atom()}],
  optional(:order_by) => [{atom(), :ASC | :DESC}],
  optional(:args) => [atom()],
  optional(:default_args) => list()
}
@callback query(args :: [db: :atom, version: String.t()]) :: binary()

Functions

Link to this function

connections(repo, opts \\ [])

View Source
@spec connections(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

db_settings(repo, opts \\ [])

View Source
@spec db_settings(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

db_status(repo, opts \\ [])

View Source
@spec db_status(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

dirty_pages_ratio(repo, opts \\ [])

View Source
@spec dirty_pages_ratio(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

index_size(repo, opts \\ [])

View Source
@spec index_size(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

long_running_queries(repo, opts \\ [])

View Source
@spec long_running_queries(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

plugins(repo, opts \\ [])

View Source
@spec plugins(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
@spec queries(repo()) :: map()
Link to this function

query(query_name, repo, opts \\ [])

View Source
@spec query(atom(), repo(), keyword()) :: :ok | MyXQL.Result.t()

Run a query with name, on repo, in the given format. The repo can be a module name or a tuple like {module, node}.

Options

  • :format - The format that results will return. Accepts :ascii or :raw. If :ascii a nice table printed in ASCII - a string will be returned. Otherwise a result struct will be returned. This option is required.

  • :args - Overwrites the default arguments for the given query. You can check the defaults of each query in its modules defined in this project.

  • :query_opts - Overwrites the default options for the Ecto query. Defaults to [log: false]

Link to this function

records_rank(repo, opts \\ [])

View Source
@spec records_rank(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

table_cache(repo, opts \\ [])

View Source
@spec table_cache(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

table_indexes_size(repo, opts \\ [])

View Source
@spec table_indexes_size(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

table_size(repo, opts \\ [])

View Source
@spec table_size(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

total_index_size(repo, opts \\ [])

View Source
@spec total_index_size(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

total_table_size(repo, opts \\ [])

View Source
@spec total_table_size(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

unused_indexes(repo, opts \\ [])

View Source
@spec unused_indexes(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

waits_for_checkpoint(repo, opts \\ [])

View Source
@spec waits_for_checkpoint(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()
Link to this function

waits_for_redolog(repo, opts \\ [])

View Source
@spec waits_for_redolog(
  repo(),
  keyword()
) :: :ok | MyXQL.Result.t()