An open API service indexing awesome lists of open source software.

https://github.com/dundalek/daba

Daba is a graphical database client for REPL-enabled queries and visualization
https://github.com/dundalek/daba

Last synced: 2 months ago
JSON representation

Daba is a graphical database client for REPL-enabled queries and visualization

Awesome Lists containing this project

README

        

# Daba Database Client

Daba is a graphical database client built on top of [Portal](https://github.com/djblue/portal).

It aims to combine some of the convenience of traditional GUI clients with the extensibility and power of [REPL](https://clojure.org/guides/repl/introduction)-based workflows.
Start with initial exploration of database schema and data visually, then manipulate results further programmatically via REPL.

| Explore schema | Query and visualize |
| - | - |
| ![Explore schema](doc/img/demo1.png) | ![Query and visualize](doc/img/demo2.png) |

Watch the [demo video](https://www.youtube.com/watch?v=DnO8jS9vYbs):

[![Daba Demo](doc/img/demo-thumbnail.avif)](https://www.youtube.com/watch?v=DnO8jS9vYbs)

## Getting Started

#### Use without installing

```
clojure -Sdeps '{:deps{io.github.dundalek/daba{:git/tag"v0.2.0":git/sha"b3c2e5e9"}}}' \
-X daba.api/open
```

#### Install as tool

```
clojure -Ttools install io.github.dundalek/daba '{:git/tag"v0.2.0"}' :as daba
```

Then run:

```
clojure -Tdaba open
````

#### Install by adding alias

`~/.clojure/deps.edn` to `:aliases` section

```clojure
{:aliases
{:daba
{:extra-deps {io.github.dundalek/daba {:git/tag "v0.2.0" :git/sha "b3c2e5e9"}}
:exec-fn daba.api/open}}}
```

Then run:
```
clojure -X:daba
```

Using this way one can also include additional JDBC drivers.

## Features

- Connect
- Connect to datasource
- Use URI string or db-spec map
- Use Datasource Input viewer for string or map
- Explore
- List databases for datasource
- List tables for database
- List columns for table
- Data grid with pagination for table data
- Query
- Execute SQL query
- Use Query Editor viewer for string
- Other
- Remove individual cards using X button
- Useful for rapid exploration of tables
- Get results as value in REPL by dereferencing Portal instance
- Visualize data using Portal's builtin `vega-lite` viewer
- Portal filtering works when selecting list of schemas, tables, columns

## Supported Databases

SQL

- PostgreSQL
- SQLite
- DuckDB
- XTDB2 (using Postgres driver)
- H2
- ...
- And likely other databases that provide a JDBC driver.

Datomic
- To connect specify [arg map](https://docs.datomic.com/client-api/datomic.client.api.html#var-client) like for `d/client` in the datasource input ([example](example/datomic.clj)):
```clojure
{:server-type :datomic-local
:system "datomic-samples"
:storage-dir "path/to/storage")}
```

XTDB1
- To connect specify [configuration map](https://v1-docs.xtdb.com/guides/quickstart/#_configure_xtdb) like for `xt-start-node` in the datasource input ([example](example/xtdb.clj)):
```clojure
{:xtdb/tx-log ...
:xtdb/document-store ...
:xtdb/index-store ...}
```

## API

See [API.md](doc/API.md) and [example/user.clj](example/user.clj) which includes examples using the API from REPL.