View Source EctoPSQLExtras behaviour (ecto_psql_extras v0.8.3)

The entry point for each function.

Summary

Functions

Run all_locks query on repo, in the given format.

Run bloat query on repo, in the given format.

Run blocking query on repo, in the given format.

Run cache_hit query on repo, in the given format.

Run calls query on repo, in the given format.

Run connections query on repo, in the given format.

Run db_settings query on repo, in the given format.

Run diagnose query on repo, in the given format.

Run duplicate_indexes query on repo, in the given format.

Run extensions query on repo, in the given format.

Run index_cache_hit query on repo, in the given format.

Run index_size query on repo, in the given format.

Run index_usage query on repo, in the given format.

Run kill_all query on repo, in the given format.

Run locks query on repo, in the given format.

Run long_running_queries query on repo, in the given format.

Run mandelbrot query on repo, in the given format.

Run null_indexes query on repo, in the given format.

Run outliers query on repo, in the given format.

Returns all queries and their modules.

Run a query with name, on repo, in the given format.

Run records_rank query on repo, in the given format.

Run seq_scans query on repo, in the given format.

Run ssl_used query on repo, in the given format.

Run table_cache_hit query on repo, in the given format.

Run table_indexes_size query on repo, in the given format.

Run table_size query on repo, in the given format.

Run total_index_size query on repo, in the given format.

Run total_table_size query on repo, in the given format.

Run unused_indexes query on repo, in the given format.

Run vacuum_stats query on repo, in the given format.

Types

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

Callbacks

@callback info() :: %{
  :title => binary(),
  :columns => [%{name: atom(), type: atom()}],
  optional(:order_by) => [{atom(), :asc | :desc}],
  optional(:index) => integer(),
  optional(:default_args) => list(),
  optional(:args_for_select) => list()
}
@callback query() :: binary()

Functions

Link to this function

all_locks(repo, opts \\ [])

View Source

Run all_locks query on repo, in the given format.

format is either :ascii or :raw

Run bloat query on repo, in the given format.

format is either :ascii or :raw

Link to this function

blocking(repo, opts \\ [])

View Source

Run blocking query on repo, in the given format.

format is either :ascii or :raw

Link to this function

cache_hit(repo, opts \\ [])

View Source

Run cache_hit query on repo, in the given format.

format is either :ascii or :raw

Run calls query on repo, in the given format.

format is either :ascii or :raw

Link to this function

connections(repo, opts \\ [])

View Source

Run connections query on repo, in the given format.

format is either :ascii or :raw

Link to this function

db_settings(repo, opts \\ [])

View Source

Run db_settings query on repo, in the given format.

format is either :ascii or :raw

Link to this function

diagnose(repo, opts \\ [])

View Source

Run diagnose query on repo, in the given format.

format is either :ascii or :raw

Link to this function

duplicate_indexes(repo, opts \\ [])

View Source

Run duplicate_indexes query on repo, in the given format.

format is either :ascii or :raw

Link to this function

extensions(repo, opts \\ [])

View Source

Run extensions query on repo, in the given format.

format is either :ascii or :raw

Link to this function

index_cache_hit(repo, opts \\ [])

View Source

Run index_cache_hit query on repo, in the given format.

format is either :ascii or :raw

Link to this function

index_size(repo, opts \\ [])

View Source

Run index_size query on repo, in the given format.

format is either :ascii or :raw

Link to this function

index_usage(repo, opts \\ [])

View Source

Run index_usage query on repo, in the given format.

format is either :ascii or :raw

Link to this function

kill_all(repo, opts \\ [])

View Source

Run kill_all query on repo, in the given format.

format is either :ascii or :raw

Run locks query on repo, in the given format.

format is either :ascii or :raw

Link to this function

long_running_queries(repo, opts \\ [])

View Source

Run long_running_queries query on repo, in the given format.

format is either :ascii or :raw

Link to this function

mandelbrot(repo, opts \\ [])

View Source

Run mandelbrot query on repo, in the given format.

format is either :ascii or :raw

Link to this function

null_indexes(repo, opts \\ [])

View Source

Run null_indexes query on repo, in the given format.

format is either :ascii or :raw

Link to this function

outliers(repo, opts \\ [])

View Source

Run outliers query on repo, in the given format.

format is either :ascii or :raw

Link to this function

pg_stat_statements_version(repo)

View Source
@spec queries(repo() | nil) :: map()

Returns all queries and their modules.

If a repository is given, it will be queried for extensions support and special queries will be included if available.

Link to this function

query(name, repo, opts \\ [log: false])

View Source

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 :raw a result struct will be returned. Otherwise it returns a nice table printed in ASCII - a string. 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

Run records_rank query on repo, in the given format.

format is either :ascii or :raw

Link to this function

seq_scans(repo, opts \\ [])

View Source

Run seq_scans query on repo, in the given format.

format is either :ascii or :raw

Link to this function

ssl_used(repo, opts \\ [])

View Source

Run ssl_used query on repo, in the given format.

format is either :ascii or :raw

Link to this function

table_cache_hit(repo, opts \\ [])

View Source

Run table_cache_hit query on repo, in the given format.

format is either :ascii or :raw

Link to this function

table_indexes_size(repo, opts \\ [])

View Source

Run table_indexes_size query on repo, in the given format.

format is either :ascii or :raw

Link to this function

table_size(repo, opts \\ [])

View Source

Run table_size query on repo, in the given format.

format is either :ascii or :raw

Link to this function

total_index_size(repo, opts \\ [])

View Source

Run total_index_size query on repo, in the given format.

format is either :ascii or :raw

Link to this function

total_table_size(repo, opts \\ [])

View Source

Run total_table_size query on repo, in the given format.

format is either :ascii or :raw

Link to this function

unused_indexes(repo, opts \\ [])

View Source

Run unused_indexes query on repo, in the given format.

format is either :ascii or :raw

Link to this function

vacuum_stats(repo, opts \\ [])

View Source

Run vacuum_stats query on repo, in the given format.

format is either :ascii or :raw