Skip to content

feat: dbts watch — file-watcher auto-rebuild #13

Description

@luiul

Summary

Watch the dbt project's models/ tree and auto-run dbts build --select <changed>+ whenever files change.

Why

Tightens the feedback loop for iterative model dev — no need to manually re-trigger after each save. Useful for incremental tinkering on a single model or small DAG.

Caveats

  • Likely overlaps with dbt's own --defer / state-based workflows.
  • Could over-trigger on noisy editors that save partial files.
  • Filing for visibility / discussion before committing to it.

Sketch

  • watchdog (or watchfiles) listening on models/.
  • Debounce burst saves (300–500 ms).
  • For each event batch: resolve changed paths → model names → dbt_runner.run("build", ...).
  • Default selector strategy: just the changed nodes (no +); flag for + if you want descendants.

Where it'd live

  • New module src/dbts/watch.py.
  • New dependency on watchdog or watchfiles.

Effort

Medium — main work is debounce + clean shutdown handling.

Tier

Tier 2 — lesser idea (maybe duplicative of dbt's own deferral / hot-reload work).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions