All Projects → lambdaisland → metabase-datomic

lambdaisland / metabase-datomic

Licence: MPL-2.0 license
Datomic driver for Metabase

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to metabase-datomic

Cboard
An easy to use, self-service open BI reporting and BI dashboard platform.
Stars: ✭ 2,795 (+4637.29%)
Mutual labels:  metabase, business-intelligence
Metabase
The simplest, fastest way to get business intelligence and analytics to everyone in your company 😋
Stars: ✭ 26,803 (+45328.81%)
Mutual labels:  metabase, business-intelligence
automile-php
Automile offers a simple, smart, cutting-edge telematics solution for businesses to track and manage their business vehicles.
Stars: ✭ 28 (-52.54%)
Mutual labels:  business-intelligence
query2report
Query2Report is a simple open source business intelligence platform that allows users to build report/dashboard for business analytics or enterprise reporting
Stars: ✭ 43 (-27.12%)
Mutual labels:  business-intelligence
automile-net
Automile offers a simple, smart, cutting-edge telematics solution for businesses to track and manage their business vehicles.
Stars: ✭ 24 (-59.32%)
Mutual labels:  business-intelligence
Data-Visualizations
Data Visualizations is emerging as one of the most essential skills in almost all of the IT and Non IT Background Sectors and Jobs. Using Data Visualizations to make wiser decisions which could land the Business to make bigger profits and understand the root cause and behavioral analysis of people and customers associated to it. In this Reposito…
Stars: ✭ 55 (-6.78%)
Mutual labels:  business-intelligence
MLiFC
Course Material for the machine learning in financial context bootcamp
Stars: ✭ 102 (+72.88%)
Mutual labels:  business-intelligence
eastmoney
python requests + Django+ nodejs koa+ mysql to crawl eastmoney fund and stock data,for data analysis and visualiaztion .
Stars: ✭ 56 (-5.08%)
Mutual labels:  metabase
EDA
Enterprise Data Analytics by Jortilles ( EDA )
Stars: ✭ 59 (+0%)
Mutual labels:  business-intelligence
BETL-old
BETL. Meta data driven ETL generation using T-SQL
Stars: ✭ 17 (-71.19%)
Mutual labels:  business-intelligence
harlan
Harlan é o sistema modular que permite você automatizar toda sua governança cadastral da nuvem.
Stars: ✭ 25 (-57.63%)
Mutual labels:  business-intelligence
neo4j-jdbc
JDBC driver for Neo4j
Stars: ✭ 110 (+86.44%)
Mutual labels:  business-intelligence
NBi
NBi is a testing framework (add-on to NUnit) for Business Intelligence and Data Access. The main goal of this framework is to let users create tests with a declarative approach based on an Xml syntax. By the means of NBi, you don't need to develop C# or Java code to specify your tests! Either, you don't need Visual Studio or Eclipse to compile y…
Stars: ✭ 102 (+72.88%)
Mutual labels:  business-intelligence
dashinator
Dashinator the daringly delightful dashboard. A replacement for dashing
Stars: ✭ 56 (-5.08%)
Mutual labels:  business-intelligence
dbt-spotify-analytics
Containerized end-to-end analytics of Spotify data using Python, dbt, Postgres, and Metabase
Stars: ✭ 92 (+55.93%)
Mutual labels:  metabase
JimuReport
「低代码可视化报表」类似excel操作风格,在线拖拽完成设计!功能涵盖: 报表设计、图形报表、打印设计、大屏设计等,完全免费!秉承“简单、易用、专业”的产品理念,极大的降低报表开发难度、缩短开发周期、解决各类报表难题。
Stars: ✭ 2,895 (+4806.78%)
Mutual labels:  metabase
datart
Datart is a next generation Data Visualization Open Platform
Stars: ✭ 1,042 (+1666.1%)
Mutual labels:  business-intelligence
web-dashboard-demo
The following application contains the DevExpress Dashboard Component for Angular. The client side is hosted on the GitHub Pages and gets data from the server side that hosts on DevExpress.com.
Stars: ✭ 65 (+10.17%)
Mutual labels:  business-intelligence
sso-examples
Single Sign-On (SSO) examples for Metabase integration
Stars: ✭ 39 (-33.9%)
Mutual labels:  metabase
metabase-school
A Metabase-integrated, real-time collaborative tool for writing SQL
Stars: ✭ 40 (-32.2%)
Mutual labels:  metabase

metabase-datomic

A Metabase driver for Datomic.

Commercial support is provided by Gaiwan.

Try it!

docker run -p 3000:3000 lambdaisland/metabase-datomic

Design decisions

See the Architecture Decision Log

Developing

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 [email protected]:metabase/metabase.git
$ git clone [email protected]: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 [email protected] 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!)

Installing

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

Configuration EDN

When you configure a Datomic Database in Metabase you will notice a config field called "Configuration EDN". Here you can paste a snippet of EDN which will influence some of the Driver's behavior.

The EDN needs to represent a Clojure map. These keys are currently understood

  • :inclusion-clauses
  • :tx-filter
  • :relationships

Other keys are ignored.

:inclusion-clauses

Datomic does not have tables, but nevertheless the driver will map your data to Metabase tables based on the attribute names in your schema. To limit results to the right entities it needs to do a check to see if a certain entity logically belongs to such a table.

By default these look like this

[(or [?eid :user/name]
     [?eid :user/password]
     [?eid :user/roles])]

In other words we look for entities that have any attribute starting with the given prefix. This can be both suboptimal (there might be a single attribute with an index that is faster to check), and it may be wrong, depending on your setup.

So we allow configuring this clause per table. The configured value should be a vector of datomic clauses. You have the full power of datalog available. Use the special symbol ?eid for the entity that is being filtered.

{:inclusion-clauses {"user" [[?eid :user/handle]]}}

:tx-filter

The datomic.api/filter function allows you to get a filtered view of the database. A common use case is to select datoms based on metadata added to transaction entities.

You can set :tx-filter to any form that evaluates to a Clojure function. Make sure any namespaces like datomic.api are fully qualified.

{:tx-filter
 (fn [db ^datomic.Datom datom]
   (let [tx-user (get-in (datomic.api/entity db (.tx datom)) [:tx/user :db/id])]
     (or (nil? tx-tenant) (= 17592186046521 tx-user))))}

:rules

This allows you to configure Datomic rules. These then become available in the native query editor, as well in :inclusion-clauses and :relationships.

{:rules
 [[(sub-accounts ?p ?c)
   [?p :account/children ?c]]
  [(sub-accounts ?p ?d)
   [?p :account/children ?c]
   (sub-accounts ?c ?d)]]}

:relationships

This features allows you to add "synthetic foreign keys" to tables. These are fields that Metabase will consider to be foreign keys, but in reality they are backed by an arbitrary lookup path in Datomic. This can include reverse reference (:foo/_bar) and rules.

To set up an extra relationship you start from the table where you want to add the relationship, then give it a name, give the path of attributes and rules needed to get to the other entity, and specifiy which table the resulting entity belongs to.

{:relationships
 {;; foreign keys added to the account table
  :account
  {:journal-entry-lines
   {:path [:journal-entry-line/_account]
    :target :journal-entry-line}

   :subaccounts
   {:path [sub-accounts]
    :target :account}

   :parent-accounts
   {:path [_sub-accounts] ;; apply a rule in reverse
    :target :account}}

  ;; foreign keys added to the journal-entry-line table
  :journal-entry-line
  {:fiscal-year
   {:path [:journal-entry/_journal-entry-lines
           :ledger/_journal-entries
           :fiscal-year/_ledgers]
    :target :fiscal-year}}}}

Status

FeatureSupported?
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-aggregationsYes
    {:aggregation aggregation-clause}Yes
        [:stddev concrete-field]Yes
:foreign-keysYes
    {: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-queriesYes
    {:source-query query}Yes
:binning
:case-sensitivity-string-filter-optionsYes

License

Copyright © 2019 Arne Brasseur

Licensed under the term of the Mozilla Public License 2.0, see LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].