Liking cljdoc? Tell your friends :D

postgres-extras-clj.core

A namespace of useful functions for inspecting PostgreSQL databases in Clojure.

The SQL query logic is based on

Queries ported to HugSQL syntax to access them as Clojure data structures.

A namespace of useful functions for inspecting
PostgreSQL databases in Clojure.
 
 The SQL query logic is based on

   * https://github.com/heroku/heroku-pg-extras/tree/main
   * https://github.com/pawurb/ecto_psql_extras/tree/main
   * https://github.com/rustprooflabs/pgdd
 
 Queries ported to HugSQL syntax to access them
 as Clojure data structures.
raw docstring

all-locksclj

source

bloatclj

source

blockingclj

source

cache-hitclj

source

callsclj

source

columnsclj

source

connectionsclj

source

databasesclj

source

db-settingsclj

source

default-diagnostic-fnsclj

Defines the critical queries and their cutoffs for the diagnose function. The value is a map containing a predicate fn (true = pass) to test against each result, and a description of the problem if false.

Defines the critical queries and their cutoffs for the `diagnose`
function. The value is a map containing a predicate fn (true = pass)
to test against each result, and a description of the problem if false.
sourceraw docstring

diagnoseclj

(diagnose stats
          &
          {:keys [diagnostic-fns] :or {diagnostic-fns default-diagnostic-fns}})

Run assertions on stats and return a seq of result maps. Iterate through the diagnostic functions, run them, then iterate through each record, applying the predicate. Returns a flat list of result maps.

Run assertions on stats and return a seq of result maps.
Iterate through the diagnostic functions, run them,
then iterate through each record, applying the predicate. 
Returns a flat list of result maps.
sourceraw docstring

diagnose-warningsclj

(diagnose-warnings stats
                   &
                   {:keys [diagnostic-fns]
                    :or {diagnostic-fns default-diagnostic-fns}})

Run assertions on stats and return a seq of result maps. Iterate through the diagnostic functions, then through the results, applying the predicate. Returns a flat list of result maps, filtered to contain only actionable warnings. An empty return sequence indicates all your dianostics passed.

Run assertions on stats and return a seq of result maps.
Iterate through the diagnostic functions,
then through the results, applying the predicate. 
Returns a flat list of result maps, filtered to contain
only actionable warnings. An empty return sequence indicates
all your dianostics passed.
sourceraw docstring

duplicate-indexesclj

source

extensionsclj

source

functionsclj

source

health-checkclj

source

index-cache-hitclj

source

index-sizeclj

source

index-usageclj

source

indexesclj

source

kill-all!clj

source

locksclj

source

long-running-queriesclj

source

mandelbrotclj

source

null-indexesclj

source

outliersclj

source

partition-childrenclj

source

partition-parentsclj

source

read-data-dictionaryclj

(read-data-dictionary db)

Create a data dictionary summarizing all major objects in your PostgreSQL database. Respects SQL COMMMENTS, thus serves as a human-readable description of your data model.

Create a data dictionary summarizing all major objects
in your PostgreSQL database. Respects SQL COMMMENTS,
thus serves as a human-readable description of your data model.
sourceraw docstring

read-statsclj

(read-stats db & {:keys [limit] :or {limit 10}})

Query postgres instance for all available diagnostic information. This will invoke all of the public, read-only diagnostic queries in the namespace.

The :outliers and :calls stats require enabling the pg-stat-statements extension, otherwise they will log a warning and return nil.

Query postgres instance for all available diagnostic information.
This will invoke all of the public, read-only diagnostic queries in the namespace.

The :outliers and :calls stats require enabling the pg-stat-statements extension,
otherwise they will log a warning and return nil.
sourceraw docstring

records-rankclj

source

schemasclj

source

seq-scansclj

source

table-cache-hitclj

source

table-indexes-sizeclj

source

table-sizeclj

source

tablesclj

source

total-index-sizeclj

source

total-table-sizeclj

source

unused-indexesclj

source

vacuum-statsclj

source

viewsclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close