Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

rw-blackbox

RisingWave blackbox solver.

Given RisingWave SQL files and a goal sink, compute the minimal upstream dependency subset, then emit:

  1. Setup SQL — exact original statements needed from required sources through intermediates to the goal sink.
  2. Test plan — connector metadata for those sources and the goal sink (mocks/assertions placeholders; engine later).

Canonical product description: docs/VISION.md.

Module: github.com/lolocompany/rw-blackbox · CLI/package: rwbb

Requires CGO (CGO_ENABLED=1) because parsing uses pg_query.

CLI

make build
./dist/rwbb --help

# From files → write setup.sql + testplan.yaml
./dist/rwbb -s snk -o /tmp/out path/to/script.sql

# From stdin (pipe/redirect only; interactive TTY shows help)
cat script.sql | ./dist/rwbb --sink snk --outdir /tmp/out

# Resolve source schemas that aren't in the SQL (registry encodings) from files
./dist/rwbb -s snk -o /tmp/out --schema-dir path/to/schemas path/to/script.sql

Flags:

  • -s / --sink — goal sink name (bare or schema-qualified); required
  • -o / --outdir — directory for setup.sql and testplan.yaml; required
  • -S / --schema-dir — directory of <source>.avsc / <source>.json schema files, used for sources whose schema is defined in a registry rather than the SQL; optional

Library

sol, err := rwbb.Solve(sql, "goal_sink")
// sol.SetupSQL  — verbatim setup statements, topologically ordered
// sol.TestPlan  — required sources + goal sink (+ empty mocks/assertions)

// Optionally resolve registry schemas from a local directory:
sol, err = rwbb.Solve(sql, "goal_sink", rwbb.WithSchemaResolver(resolver))

See pkg/rwbb.

Checks

make lint
make test
make test-race

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages