feat(viewer): erDiagram shows real column types when present; ArtifactView accepts a {content} sql wrapper
erDiagram reads data_type/type from the candidate (top-level or signals),
falling back to the generic 'col' token Mermaid needs — real types render as
soon as schema_linking.json carries them. ArtifactView gains a defensive
{content} fallback for sql-kind artifacts, verified against real session shapes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,11 @@ test("sql artifact renders the SQL text", () => {
|
||||
expect(screen.getByText("SELECT 1")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("sql artifact accepts a { content } wrapper", () => {
|
||||
render(<ArtifactView artifact={{ kind: "sql", data: { content: "SELECT 7" } }} />);
|
||||
expect(screen.getByText("SELECT 7")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("cte_plan renders an ordered list of names", () => {
|
||||
render(<ArtifactView artifact={{ kind: "cte_plan", data: { names: ["a_cte", "b_cte"] } }} />);
|
||||
expect(screen.getByText("a_cte")).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user