{"id":18646769,"url":"https://github.com/metabase/sudoku-driver","last_synced_at":"2025-10-08T22:05:28.121Z","repository":{"id":40424175,"uuid":"161554930","full_name":"metabase/sudoku-driver","owner":"metabase","description":"Sample Metabase driver that generates sudoku boards","archived":false,"fork":false,"pushed_at":"2023-03-08T18:22:11.000Z","size":64,"stargazers_count":7,"open_issues_count":2,"forks_count":19,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-03-25T14:11:11.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metabase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-12T22:50:55.000Z","updated_at":"2022-12-04T16:45:10.000Z","dependencies_parsed_at":"2024-11-07T06:26:30.386Z","dependency_job_id":"7af3e5d7-9113-4466-bda3-dec581c5bd82","html_url":"https://github.com/metabase/sudoku-driver","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabase%2Fsudoku-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabase%2Fsudoku-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabase%2Fsudoku-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabase%2Fsudoku-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metabase","download_url":"https://codeload.github.com/metabase/sudoku-driver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248402009,"owners_count":21097328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:22:29.722Z","updated_at":"2025-10-08T22:05:23.081Z","avatar_url":"https://github.com/metabase.png","language":"Clojure","funding_links":[],"categories":["Metabase Examples"],"sub_categories":["Official Examples"],"readme":"# Sample Metabase Driver: Sudoku\n\n![screenshot](screenshots/sudoku-driver.png)\n\nAll you need you do is drop the driver in your `/path/to/metabase/plugins/` directory.\n\n## Building the driver\n\n## Prereq: Install the Clojure CLI\n\nMake sure you have the `clojure` CLI version `1.10.3.933` or newer installed; you can check this with `clojure\n--version`. Follow the instructions at https://clojure.org/guides/getting_started if you need to install a\nnewer version.\n\n## Prereq: Clone the Metabase core repo\n\n```sh\ngit clone https://github.com/metabase/metabase\n```\n\n## Build it (Updated for build script changes in Metabase 0.46.0)\n\nUnfortunately the current command for building a driver is quite a mouthful, but we needed to make changes to how the\nMetabase build script works to avoid issues with dependencies shadowing one another. Please upvote\nhttps://ask.clojure.org/index.php/7843/allow-specifying-aliases-coordinates-that-point-projects , which will allow us\nto make building drivers much more convenient in the future!\n\n```sh\n# Example for building the driver with bash or similar\n\n# switch to the local checkout of the Metabase repo\ncd /path/to/metabase/repo\n\n# get absolute path to the driver project directory\nDRIVER_PATH=`readlink -f ~/sudoku-driver`\n\n# Build driver. See explanation below\nclojure \\\n  -Sdeps \"{:aliases {:sudoku {:extra-deps {com.metabase/sudoku-driver {:local/root \\\"$DRIVER_PATH\\\"}}}}}\"  \\\n  -X:build:sudoku \\\n  build-drivers.build-driver/build-driver! \\\n  \"{:driver :sudoku, :project-dir \\\"$DRIVER_PATH\\\", :target-dir \\\"$DRIVER_PATH/target\\\"}\"\n```\n\nNotes/explanation:\n\n* This has to be run from the directory where you've checked out the [Metabase\n  repo](https://github.com/metabase/metabase) locally\n\n* We need to add an extra extra dependency on our driver to Metabase so it can see our driver's source files:\n\n  ```sh\n  -Sdeps \"{:aliases {:sudoku {:extra-deps {com.metabase/sudoku-driver {:local/root \\\"$DRIVER_PATH\\\"}}}}}\"\n  ```\n\n  We accomplished this by using `-Sdeps` to define a new alias, `:sudoku`, and having it inject `:extra-deps` that point\n  to our driver's `deps.edn` project file. The name we used for the alias, `:sudoku`, is arbitrary, as is the name we\n  gave our dependency -- `com.metabase/sudoku-driver`.\n\n  For convenience you can save this alias in your `~/.clojure/deps.edn` file for future use if you'd like.\n\n  The `:local/root` path does not *need* to be absolute, so you can hardcode it to something relative to the Metabase\n  root directory, e.g. `../sudoku-driver`. Note that does not understand `~` however. Probably safer just to make it\n  absolute tho.\n\n* With our newly-created alias in hand, we can invoke the Metabase driver build script with\n\n  ```sh\n  -X:build:sudoku build-drivers.build-driver/build-driver!`\n  ```\n\n* Clojure functions invoked with `-X` take a Clojure map literal as their options:\n\n  ```sh\n  \"{:driver :sudoku, :project-dir \\\"$DRIVER_PATH\\\", :target-dir \\\"$DRIVER_PATH/target\\\"}\"\n  ```\n\n  If running the command from a shell, you'll want to wrap the map literal inside quotation marks. If you're invoking\n  the shell script from something more sophisticated, just make sure the argument getting passed in can be read as\n  a Clojure map literal. `clojure` ultimately needs to see something like\n\n  ```clj\n  {:driver :sudoku, :project-dir \"/home/cam/sudoku-driver\", :target-dir \"/home/cam/sudoku-driver/target\"}\n  ```\n\n  There are three options we're passing to `build-drivers.build-driver/build-driver!` here:\n\n  * `:driver`, the name of the driver we're building. This needs to match the name of the driver namespace\n    `metabase.driver.\u003cdriver\u003e`\n\n  * `:project-dir`, the root directory of your driver project. Currently this has to be an absolute path! You can use\n    `readlink` to get an absolute path if you're using a *nix shell or WSL\n\n  * `:target-dir` is the dir the resulting artifact will output to. In this case the resulting artifact will be\n    `/home/cam/sudoku-driver/target/sudoku.metabase-driver.jar`\n\nOnce the driver is built, you can copy this file to `/path/to/metabase/plugins/` and restart your server, and the\ndriver will show up.\n\n## Hacking on the driver locally\n\nIt's easiest to create an alias in `~/.clojure/deps.edn` to include the source paths for your driver, e.g.\n\n```clojure\n;; ~/.clojure/deps.edn\n{:aliases\n {:user/sudoku-driver\n  {:extra-deps {metabase/sudoku-driver {:local/root \"/home/cam/sudoku-driver\"}}\n   :jvm-opts   [\"-Dmb.dev.additional.driver.manifest.paths=/home/cam/sudoku-driver/resources/metabase-plugin.yaml\"]}}}\n```\n\nAnd then start a (n)REPL or run a dev server from the main Metabase project directory with something like:\n\n```sh\n# start a regular REPL\nclojure -M:user/sudoku-driver\n\n# start an nREPL\nclojure -M:user/sudoku-driver:nrepl\n\n# start a local dev server server\nclojure -M:user/sudoku-driver:run\n```\n\nYou can also pass these options directly to `clojure` e.g.\n\n```sh\n# start the dev server\nclojure \\\n  -Sdeps '{:deps {metabase/sudoku-driver {:local/root \"/home/cam/sudoku-driver\"}}}' \\\n  -J-Dmb.dev.additional.driver.manifest.paths=/home/cam/sudoku-driver/resources/metabase-plugin.yaml \\\n  -M:run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetabase%2Fsudoku-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetabase%2Fsudoku-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetabase%2Fsudoku-driver/lists"}