Skip to content

Column analysis

Aggregate filters, joins, SELECT INTO mappings, and predicates per procedure or package — the machine-readable entry point for test-data and mock generation.

Aggregate per procedure

codeweb columns exports, per procedure or package: hard filters, join conditions, SELECT INTO mappings, and enum/column mappings. Exactly one of --procedure or --package is required:

codeweb columns --procedure "proc_create_order" --format json
codeweb columns --package "pkg_order" --format json
codeweb columns --package "pkg_order" --table "orders" --format json   # narrow to one table

Output is JSON (schema from issue #165). --procedure and --package use the same substring matching as trace; matching more than one node fails the command.

Seed hints

--format seed-hints (issue #181) renders a table-requirements inventory for generating test data: involved tables with per-table operations, the routine signature, hard filters, cross-table equalities, and discriminator values. Each entry carries provenance and confidence.

codeweb columns --procedure "proc_create_order" --format seed-hints
codeweb columns --procedure "proc_create_order" --format seed-hints \
  --discriminator "operation_no"
  • --discriminator names a column whose literal values are enumerated as discriminator_values. The flag is repeatable and overrides the discriminator_columns list from codeweb.toml:
[analysis]
discriminator_columns = ["operation_no"]

By default the list is empty: codeweb has no built-in domain knowledge, so a project opts in explicitly.

Predicates

codeweb predicates --procedure <NAME> resolves PL IF/CASE conditions to table columns and outputs JSON:

codeweb predicates --procedure "proc_create_order" --format json

--format json is the only supported value today.

Mark WDR report rows

codeweb mark annotates rows of a WDR SQL detail CSV with their relation to a target graph node — useful for tying slow-SQL reports back to procedures and mappers:

codeweb mark --csv wdr_sql_detail.csv --node "proc_create_order" -o marked.csv
codeweb mark --csv wdr_sql_detail.csv --node "orders" --node "pkg_order"   # multiple targets, stdout

Interfaces

The aggregated column analysis is exposed on every surface:

  • CLI: codeweb columns, codeweb predicates
  • HTTP: GET /api/v1/columns?procedure=...|package=...[&table=...]
  • MCP: codeweb_column_analysis (same JSON schema as the CLI)