Shell REPL helpers that access the running Integrant system. These functions take system components as arguments — they do NOT directly access the running system. Wiring happens in dev/repl/user.clj.
Shell REPL helpers that access the running Integrant system. These functions take system components as arguments — they do NOT directly access the running system. Wiring happens in dev/repl/user.clj.
(active-traces-list)Return the set of handler names currently being traced.
Return the set of handler names currently being traced.
(build-query-map table opts)Build a HoneySQL query map for the given table.
opts keys: :where — HoneySQL where clause :order-by — HoneySQL order-by clause :limit — row limit (default 20)
Build a HoneySQL query map for the given table. opts keys: :where — HoneySQL where clause :order-by — HoneySQL order-by clause :limit — row limit (default 20)
(build-simulate-request method path opts)Build a Ring request map for simulating an HTTP call.
opts keys: :body — EDN/map body, will be JSON-encoded :raw-body — raw string body, passed as-is (for non-JSON text replay) :raw-bytes — raw byte array, passed directly (for binary replay) :headers — extra headers map :query-params — map of query params (encoded into :query-string for wrap-params) :query-string — raw query string (used as-is, takes precedence over :query-params)
Build a Ring request map for simulating an HTTP call. opts keys: :body — EDN/map body, will be JSON-encoded :raw-body — raw string body, passed as-is (for non-JSON text replay) :raw-bytes — raw byte array, passed directly (for binary replay) :headers — extra headers map :query-params — map of query params (encoded into :query-string for wrap-params) :query-string — raw query string (used as-is, takes precedence over :query-params)
(count-rows db-context table)Count total rows in the given table. Returns a single integer.
Count total rows in the given table. Returns a single integer.
(extract-module handler-str)Extract module name from a handler string. Works with both qualified symbol strings and compiled fn str representations. Returns the module name string (e.g. 'user', 'admin', 'platform') or nil for non-boundary handlers.
Extract module name from a handler string. Works with both qualified symbol strings and compiled fn str representations. Returns the module name string (e.g. 'user', 'admin', 'platform') or nil for non-boundary handlers.
(extract-routes-from-handler http-handler)Extract route info from a compiled Ring handler backed by Reitit. Checks handler metadata for :reitit/router first (set by compile-routes), then falls back to reitit.ring/get-router for unwrapped handlers. Returns a seq of {:method :path :handler :module} maps, or nil on error.
Extract route info from a compiled Ring handler backed by Reitit.
Checks handler metadata for :reitit/router first (set by compile-routes),
then falls back to reitit.ring/get-router for unwrapped handlers.
Returns a seq of {:method :path :handler :module} maps, or nil on error.(find-dependents config component-key)Find Integrant keys that transitively depend on component-key. Returns the full transitive closure in dependency-safe restart order: if dependent A is also referenced by dependent B, A appears before B so that restarting in sequence leaves every component wired to fresh instances rather than stale refs.
Algorithm: BFS to collect the dependent set, then topological sort within that set using Kahn's algorithm.
Find Integrant keys that transitively depend on component-key. Returns the full transitive closure in dependency-safe restart order: if dependent A is also referenced by dependent B, A appears before B so that restarting in sequence leaves every component wired to fresh instances rather than stale refs. Algorithm: BFS to collect the dependent set, then topological sort within that set using Kahn's algorithm.
(remove-trace! handler-name)Remove a trace for the given handler name. Returns a confirmation message string.
Remove a trace for the given handler name. Returns a confirmation message string.
(restart-component system-var config component-key)Halt and reinitialize a single Integrant component.
system-var: the var holding the running system (a plain def, not an atom) config: the Integrant config map component-key: the key to restart
Note: integrant.repl.state/system is a plain def, not an atom. We use alter-var-root to update it atomically.
Warning: dependents that captured the old instance are NOT updated. Use (reset) for cascading restarts.
Halt and reinitialize a single Integrant component. system-var: the var holding the running system (a plain def, not an atom) config: the Integrant config map component-key: the key to restart Note: integrant.repl.state/system is a plain def, not an atom. We use alter-var-root to update it atomically. Warning: dependents that captured the old instance are NOT updated. Use (reset) for cascading restarts.
(run-checks)Run all quality checks via 'bb check'. Returns {:exit <int> :output <string>}.
Run all quality checks via 'bb check'.
Returns {:exit <int> :output <string>}.(run-lint)Run clj-kondo linting across src, test, and all library sources. Uses a shell wrapper so glob patterns are expanded correctly. Returns {:exit <int> :output <string>}.
Run clj-kondo linting across src, test, and all library sources.
Uses a shell wrapper so glob patterns are expanded correctly.
Returns {:exit <int> :output <string>}.(run-query db-context table opts)Execute a SELECT query against the given table via db/execute-query!. Returns a seq of row maps.
Execute a SELECT query against the given table via db/execute-query!. Returns a seq of row maps.
(run-tests module meta-filter)Run Kaocha tests for the given module keyword and optional meta filter keyword. Shells out to clojure -M:test so it works from any REPL session. Returns {:exit <int> :output <string>}.
Run Kaocha tests for the given module keyword and optional meta filter keyword.
Shells out to clojure -M:test so it works from any REPL session.
Returns {:exit <int> :output <string>}.(set-trace! handler-name)Register a trace for the given handler name. Returns a confirmation message string.
Register a trace for the given handler name. Returns a confirmation message string.
(show-doc topic)Look up and print documentation for the given topic keyword. Shows available topics when the topic is unknown.
Look up and print documentation for the given topic keyword. Shows available topics when the topic is unknown.
(simulate-request http-handler method path opts)Send a simulated HTTP request to the given Ring handler. Returns {:status :headers :body} with body JSON-decoded when possible.
Send a simulated HTTP request to the given Ring handler.
Returns {:status :headers :body} with body JSON-decoded when possible.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |