A Metabase driver for Datomic.
Commercial support is provided by Gaiwan.
docker run -p 3000:3000 lambdaisland/metabase-datomic
See the Architecture Decision Log
To get a REPL based workflow, do a git clone of both metabase
and
metabase-datomic
, such that they are in sibling directories
$ git clone git@github.com:metabase/metabase.git
$ git clone git@github.com:plexus/metabase-datomic.git
$ tree -L 1
.
│
├── metabase
└── metabase-datomic
Before you can use Metabase you need to build the frontend. This step you only need to do once.
cd metabase
yarn build
And install metabase locally
lein install
Now cd
into the metabase-datomic
directory, and run bin/start_metabase
to
lauch the process including nREPL running on port 4444.
cd metabase-datomic
bin/start_metabase
Now you can connect from Emacs/CIDER to port 4444, or use the
bin/cider_connect
script to automatically connect, and to associate the REPL
session with both projects, so you can easily evaluate code in either, and
navigate back and forth.
Once you have a REPL you can start the web app. This also opens a browser at
localhost:3000
user=> (go)
The first time it will ask you to create a user and do some other initial setup.
To skip this step, invoke setup!
. This will create a user with username
arne@example.com
and password dev
. It will also create a Datomic database
with URL datomic:free://localhost:4334/mbrainz
. You are encouraged to run a
datomic-free transactor, and
import the MusicBrainz
database for testing.
user=> (setup!)
The general process is to build an uberjar, and copy the result into
your Metabase plugins/
directory. You can build a jar based on
datomic-free, or datomic-pro (assuming you have a license). Metabase
must be available as a local JAR.
cd metabase
lein install
mkdir plugins
cd ../metabase-datomic
lein with-profiles +datomic-free uberjar
# lein with-profiles +datomic-pro uberjar
cp target/uberjar/datomic.metabase-driver.jar ../metabase/plugins
Now you can start Metabase, and start adding Datomic databases
cd ../metabase
lein run -m metabase.core
Feature | Supported? |
---|---|
Basics | |
{:source-table integer-literal} | Yes |
{:fields [& field]} | Yes |
[:field-id field-id] | Yes |
[:datetime-field local-field | fk unit] | Yes |
{:breakout [& concrete-field]} | Yes |
[:field-id field-id] | Yes |
[:aggregation 0] | Yes |
[:datetime-field local-field | fk unit] | Yes |
{:filter filter-clause} | |
[:and & filter-clause] | Yes |
[:or & filter-clause] | Yes |
[:not filter-clause] | Yes |
[:= concrete-field value & value] | Yes |
[:!= concrete-field value & value] | Yes |
[:< concrete-field orderable-value] | Yes |
[:> concrete-field orderable-value] | Yes |
[:<= concrete-field orderable-value] | Yes |
[:>= concrete-field orderable-value] | Yes |
[:is-null concrete-field] | Yes |
[:not-null concrete-field] | Yes |
[:between concrete-field min orderable-value max orderable-value] | Yes |
[:inside lat concrete-field lon concrete-field lat-max numeric-literal lon-min numeric-literal lat-min numeric-literal lon-max numeric-literal] | Yes |
[:starts-with concrete-field string-literal] | Yes |
[:contains concrete-field string-literal] | Yes |
[:does-not-contain concrete-field string-literal] | Yes |
[:ends-with concrete-field string-literal] | Yes |
[:time-interval field concrete-field n :current|:last|:next|integer-literal unit relative-datetime-unit] | |
{:limit integer-literal} | Yes |
{:order-by [& order-by-clause]} | Yes |
:basic-aggregations | |
{:aggregation aggregation-clause} | |
[:count] | Yes |
[:count concrete-field] | Yes |
[:cum-count concrete-field] | Yes |
[:cum-sum concrete-field] | Yes |
[:distinct concrete-field] | Yes |
[:sum concrete-field] | Yes |
[:min concrete-field] | Yes |
[:max concrete-field] | Yes |
[:share filter-clause] | |
:standard-deviation-aggregations | Yes |
{:aggregation aggregation-clause} | Yes |
[:stddev concrete-field] | Yes |
:foreign-keys | Yes |
{:fields [& field]} | Yes |
[:fk-> fk-field-id dest-field-id] | Yes |
:nested-fields | |
:set-timezone | |
:expressions | |
{:fields [& field]} | |
[:expression] | |
{:breakout [& concrete-field]} | |
[:expression] | |
{:expressions {expression-name expression}} | |
:native-parameters | |
:expression-aggregations | |
:nested-queries | Yes |
{:source-query query} | Yes |
:binning | |
:case-sensitivity-string-filter-options | Yes |
Copyright © 2019 Arne Brasseur
Licensed under the term of the Mozilla Public License 2.0, see LICENSE.