Skip to content

dittosh v0.2.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 16:58
· 10 commits to main since this release
3d34687

dittosh v0.2.0

This release updates the bundled Ditto SDK to 5.2.0, adds a tutorial command
with interactive DQL lessons, adds a benchmark command, adds dittosh doctor --report for bug reports, adds live system
metrics to the interactive shell, shows the full execution profile the SDK reports, and refreshes
development dependencies to resolve security advisories.

New

dittosh tutorial writes a hands-on Markdown walkthrough of the CLI, tailored to
your installation (version, upgrade command, platform), from
importing and querying to diagnostics and advanced DQL.

dittosh tutorial --interactive teaches DQL in 27 guided lessons across
beginner, intermediate, and advanced levels, in a full-screen view: the lesson
stays in view at the top, results scroll below it, the ✓/✗ verdict stays
above the prompt, a sidebar outlines the lessons and your progress, Ctrl+T shows
the fields of the collections each lesson uses, and ? slides in a help panel.

  • Each lesson explains a concept (projection, predicates, functions,
    aggregation, joins, indexes, query plans, and more), shows the syntax, sets a
    task, and checks your answer.
  • Lessons run in a separate practice store, so your data is never touched.
  • Press Enter to run a statement (; is optional). Tab gives a hint, Ctrl+L
    picks a lesson from a list, Ctrl+N/Ctrl+P move between lessons, and ?
    explains everything; progress is saved between sessions.
  • --plain (or a window smaller than 60×20) uses a simple line-by-line shell
    instead.
  • Advanced lessons cover joins, ANY … SATISFIES, indexes (including
    mixed-direction composite indexes), query plans, USE IDS, and the system
    collections.

dittosh dql bench benchmarks DQL statements: it runs each one many times and
reports mean, p50, p95, p99, min, max, and standard deviation.

  • --runs <n> sets the number of timed runs (default 50). --warmup runs the
    statement untimed first, enough to fill about 250 ms, or --warmup <n> times.
  • --pre, --before-each (also --reset), --after-each, and --post run statements once
    before timing, before every run (untimed), after every successful run (untimed), and once
    afterwards (even after a failure). Use them to
    create and drop indexes, or to put data back so every run of a write does the
    same work.
  • -f <file> runs benchmarks from a JSON file, in the same format as Ditto's DQL
    benchmark suites (query, preQueries, resetQueries, postQueries), plus a
    dittosh-only afterEachQueries.
    --example <dataset> writes a sample file to start from. See
    docs/benchmarking.md.
  • dittosh dql dataset run <query> --runs <n> --warmup benchmarks a query from
    a sample dataset's catalog.

dittosh doctor --report writes one .tar.gz file to attach to a GitHub issue.

  • It holds versions, OS and terminal details, the health checks, paths and free
    disk space, dittosh settings (credentials only as set/not set), a store summary
    (collection names, document counts, indexes; no document contents), and the
    last failed command with its error output.
  • It includes the Ditto SDK 5.2 support bundle: the SDK's debug logs and the
    store configuration with secrets removed. dittosh dql support-bundle saves
    just that bundle.
  • --no-store and --no-sdk-bundle leave parts out. The license token is never
    included, and report.md/report.json show your home folder as ~. The SDK
    bundle is included as is: it holds the database ID, file paths, and peer keys.
  • dittosh doctor now works without dql (dittosh dql doctor still works).
  • --debug (or DITTOSH_DEBUG=1) on any command shows the SDK's debug logs and
    stack traces on stderr; stdout is unchanged.
  • A bug-report issue template asks for the file. See docs/troubleshooting.md.

The interactive dittosh dql shell has a new .metrics command that shows
the SDK's live system metrics as formatted tables.

  • Store metrics: SQLite transactions, fsync, WAL size, commit and lock timings.
  • Query (DQL) metrics: requests, selects, failures, and parse, plan, and
    execution times.
  • Totals run since the session opened; Change, p50/p90/p99, and Max cover the
    time since the previous .metrics.
  • .metrics store or .metrics query narrows the view; .metrics all adds
    network, sync, transport, and the other sections.

Improved

dittosh dql --profile now shows everything in the SDK's profile:

  • per-operator recv, send, and stor (time blocked on storage) timings
  • scheduler yield counts by reason (budget, sender, receiver,
    heartbeat), plus total storage time and total yields in the summary
  • skipped document counts
  • join subplans (nlJoin → inner) as nested trees
  • each operator's remaining attributes
  • the database ID, request type, feature flags, and directives

Changed

  • Updated the bundled Ditto Node SDK from 5.1.0 to 5.2.0. dittosh version
    reports the new SDK version.
  • Updated vite, source-map-js, and vitest to patched versions. These are
    build and test tools only; they are not part of the installed CLI.

Installation and updates

Install with Homebrew:

brew install getditto/tap/dittosh

Update an existing install:

brew update && brew upgrade getditto/tap/dittosh

Homebrew manages Node.js 24, so you don't need Node.js or npm installed.

Supported systems: Apple Silicon macOS and Linux x64/arm64. Intel Macs are not
supported by the bundled Ditto SDK. Homebrew installs now include only your
platform's copy of the Ditto SDK, so they are much smaller (about 150 MB on
macOS, 180 MB on Linux).