Datomic QBuilder is an attempt to create a different Datomic console than the one provided by Datomic.
Here's a quick video preview of some features of the QBuilder.
In this view, one can compose/view a raw Datalog query with pull expression support.
The pull expression is enabled if the find is in the collection form, e.g.
[?e ...]
. If the find is in other form, the pull expression is disabled and ignored.
NOTE: sorting instruction definitions are currently supported only in the Datalog Builder view.
In this view, one can use the builder for building where and pull expressions.
The first column in the where section represents the entity (E), the second column the attribute (A) and the third column represents the value (V).
The builder where expressions are aware of entities and suggest the attributes belonging to the given entity only. Similarly, the builder knows the value type and for instance, if a value is an enum, it will offer all the possible enums for the given attribute.
Each expression can be moved up/down, removed and, if the current entity is linked from another entity, a "Link" button will add a where expression that links to the current entity.
The pull expressions that also support nested attributes in case of reference attribute.
NOTE: the pull section is enabled only if the find expression is in the [?e ...]
form.
Sorting can currently be specified on simple attributes, nested attribute sorting (in case of reference attributes) and advanced expressions (we are using specter on the backend) will also be supported in the future.
NOTE: the sorting section is enabled only if the find expression is in the [?e ...]
form.
The results are able to display nested data (e.g. the data obtained from Datomic by the use of the '*' pull expression)
Not yet implemented
- Datomic
You need a Datomic database, the installation of Datomic is beyond this file's scope...
Follow the instructions on mbrainz database to import a sample MBrainz Database into Datomic by issuing the following command:
./bin/datomic 'restore-db file://PATH_TO_mbrainz-1968-1973 datomic:sql://qbuilder?jdbc:postgresql://localhost:5432/datomic?user=YOUR_USERNAME&password=YOUR_PASSWORD'
The provided schema:
(./resources/migrations/schema.edn
)
is for the MBrainz Database.
- Clojure
brew install clojure
- Leiningen 2.0 or above
brew install leiningen
- Node (for the web client)
brew install node
Create the following configuration file:
dev-config.edn
And paste the following configuration:
{:dev true
:port 8080
;; when :nrepl-port is set the application starts the nREPL server on load
:nrepl-port 7000
; set your dev database connection URL here
:database-url "datomic:sql://qbuilder?jdbc:postgresql://localhost:5432/datomic?user=YOUR_USERNAME&password=YOUR_PASSWORD"
; alternatively, you can use the datomic mem db for development:
; :database-url "datomic:mem://datomic_qbuilder_datomic_dev"
}
To start the web server for the application, run:
lein run
The server will serve on port 8080.
To set up and start the web client, please see the web client README:
./client-gui/README.md