Add ability to designate a function for DB setup & automatically run it
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 576
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
Slightly inconvenient that we have to call appropriate DB setup functions when using from the REPL, e.g. in Metabase:
```clojure
(metabase.db/setup-db-if-needed!)
```
It would be more convenient if we could tag a certain function as the DB setup function:
```clojure
(defn ^:toucan/setup-fn setup-db-if-needed! []
...)
```
and have Toucan automatically find and run this function using the namespace tools if the DB is not yet set up.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing setup-db-if-needed! function and the namespace tools used for discovery. Define how a ^:toucan/setup-fn var is found and invoked when the database is not set up, while preserving current behavior; done means the REPL no longer requires an explicit setup call and the behavior is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100