Skip to content

miudb Go Preview Install

The Go preview binary is named miudb.

Release Install

brew install vanducng/tap/miudb

Alternative:

go install github.com/vanducng/miu-db/cmd/miudb@v0.2.0-go.6

Make sure your Go bin directory is on PATH when using go install:

export PATH="$(go env GOPATH)/bin:$PATH"

Verify:

miudb version --output json
miudb commands --output json

Native Config

By default miudb reads and writes native files under:

~/.config/miu/db/connections.json
~/.config/miu/db/credentials.json

The connection file stores metadata. Sensitive fields are classified before write and are stored through the selected secret backend.

Add a SQLite connection:

miudb connections add \
  --name agent-deck \
  --db-type sqlite \
  --path /Users/vanducng/.agent-deck/profiles/default/state.db \
  --output json

Add a PostgreSQL connection with Keychain/keyring-backed password storage:

miudb connections add \
  --name app-dev \
  --db-type postgresql \
  --host localhost \
  --port 5432 \
  --database app \
  --username app \
  --password "$APP_DB_PASSWORD" \
  --secret-store keyring \
  --output json

List and test:

miudb connections list --output json
miudb connections test app-dev --output json

Run a bounded query:

miudb query run \
  --connection app-dev \
  --sql "select 1 as one" \
  --limit 100 \
  --output json

Run a saved-connection health matrix:

miudb connections smoke \
  --timeout 20s \
  --concurrency 4 \
  --output json

Store Options

miudb --config-dir ~/.config/miu/db connections list --output json
miudb --connections-file ./connections.json connections list --output json
miudb --secret-source keyring,file,gopass connections test app-dev --output json

New connection secret stores:

  • keyring: OS Keychain/keyring service named miudb by default.
  • file: local credential file with mode 0600.
  • inline: leave the value in connections.json.
  • none: discard the supplied value.

For migrated configs, miudb reads credentials-export.json from the same directory when credentials.json is absent.

Local Checkout

go test ./...
go build -buildvcs=false -o ./.miu-db/miudb ./cmd/miudb
./.miu-db/miudb version --output json

-buildvcs=false avoids VCS stamping failures in git worktree layouts.