Skip to content

DX2: the shell and the first bindings #168

Description

@tamnd

Milestone DX2 of the developer-experience program (Spec/2064g/dx/00-overview.md). Specs: dx/04, dx/06, dx/12 §2, §5, dx/03 §5, dx/13 §1. Runs with M2 (#3, closed).

M2 landed the query engine, so this is where the SDKs become real. Python goes first, ahead of TypeScript and Go, for one reason: an analytical database is evaluated from a notebook, and the notebook is where a bad first impression is unrecoverable. The 60-second snippet in dx/06 §1 is the target, import zudb, zudb.connect, .to_pandas(), nothing else.

Two things here are corrections from the 2026 audit (Spec/2064g/AUDIT-2026-08.md §2.1). The wheel matrix is not one abi3 wheel: the free-threaded build has no stable ABI until CPython 3.15 and PEP 803's abi3t, so 3.14t needs a version-specific cp314-cp314t wheel, and PyO3 0.29 dropped 3.13t entirely. And the Python floor is 3.11, not 3.9.

shell (dx/12 §2):

  • multi-line editing, syntax highlighting, completion, paging
  • backslash commands, Ctrl-C cancel, progress reporting
  • JSONL session protocol v1, versioned, tested, documented (dx/12 §5)

Rust SDK v1 (dx/04):

  • query, parameters, typed rows, streaming
  • explain and profile returning structured plans, not strings

Python SDK v0 (dx/06):

  • PyO3 0.29 + maturin 1.14, three wheels per platform: cp311-abi3, cp314-cp314t, cp315-abi3.abi3t
  • the release job asserts the exact expected wheel tag set and fails on an unrequested version-specific wheel
  • context managers, iteration, to_arrow, to_pandas with Arrow-backed dtypes for pandas 3
  • .pyi stubs inside the wheel with py.typed, checked against the runtime by griffe
  • GIL released around every query, load, and appender flush
  • cold import zudb under 50 ms, gated

error model end to end (dx/03 §5):

  • GQLSTATUS through the ABI to Python and Rust as structured fields, not a formatted string
  • code, severity, position with offset/line/column, excerpt, doc_url, retryable

cancellation and progress:

  • zu_conn_interrupt, progress callbacks
  • Ctrl-C raises KeyboardInterrupt in Python within 50 ms, and interrupts in the shell

corpus and grammar:

  • results, errors, parameters: ~940 cases total, Python and Rust runners
  • tree-sitter-gql and the Shiki grammar, shared by docs, shell, and editors (dx/13 §1)

done when:

  • the 60-second snippet works verbatim in Python and Rust
  • the misuse suite passes in both: no crash, no leak, a clear error for every deliberately wrong program
  • Ctrl-C interrupts a 10-second query within 50 ms in the shell, in Python, and through the ABI

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliCLI and interactive shellconformanceConformance measurement, corpus, declarationdxDeveloper experience: SDKs, CLI, install, ergonomicsmilestoneMilestone tracking issuepythonPython SDKrustRust SDK

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions