Liking cljdoc? Tell your friends :D
Clojure only.

k16.mallard.loader.fs


load!cljmacro

(load! dir)

Load all operation files found at a given file or resource URL.

Expects files to be Clojure namespaces with exported run-up! and optionally run-down! functions.

Any metadata on the operation namespace will be loaded and included in the result.

(ns com.example.migrations.init-db
  {:some-key "some-value"})

(defn run-up! [context]
  ...)

;; Optional
(defn run-down! [context]
  ...)

This is implemented in such a way as to allow being used within GraalVM native-image compiled applications.

When used in this context, make sure to call it in the root of a loaded namespace.

(ns com.example.migrate
  (:require
   [k16.mallard.loader.fs :as loader.fs]))

;; Will be properly loaded and compiled into your native-image
(def migrations
  (loader.fs/load! "com/example/migrations"))
Load all operation files found at a given file or resource URL.

Expects files to be Clojure namespaces with exported `run-up!` and optionally
`run-down!` functions.

Any metadata on the operation namespace will be loaded and included in the
result.

```clojure
(ns com.example.migrations.init-db
  {:some-key "some-value"})

(defn run-up! [context]
  ...)

;; Optional
(defn run-down! [context]
  ...)
```

This is implemented in such a way as to allow being used within GraalVM
native-image compiled applications.

When used in this context, make sure to call it in the root of a loaded
namespace.

```clojure
(ns com.example.migrate
  (:require
   [k16.mallard.loader.fs :as loader.fs]))

;; Will be properly loaded and compiled into your native-image
(def migrations
  (loader.fs/load! "com/example/migrations"))
```
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close