Skip to content

miudb Install

The Go binary is named miudb.

Release Install

Terminal window
brew install vanducng/tap/miudb

Alternative:

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

Windows release archives are published on GitHub Releases as zip files. In PowerShell:

Terminal window
$version = "v0.2.0"
$asset = "miudb_windows_x86_64.zip"
Invoke-WebRequest "https://github.com/vanducng/miu-db/releases/download/$version/$asset" -OutFile $asset
Expand-Archive $asset -DestinationPath ".\miudb" -Force
.\miudb\miudb.exe version --output json

Use miudb_windows_arm64.zip on Windows ARM64.

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

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

Verify:

Terminal window
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:

Terminal window
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:

Terminal window
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:

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

Run a bounded query:

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

Run a saved-connection health matrix:

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

Store Options

Terminal window
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

Terminal window
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.