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:
@@ -38,6 +38,7 @@ function toSqlBlocks(raw: unknown): SqlBlock[] | null {
|
||||
const rec = asRecord(raw);
|
||||
if (!rec) return null;
|
||||
if (typeof rec.sql === "string") return [{ name: "SQL", sql: rec.sql }];
|
||||
if (typeof rec.content === "string") return [{ name: "SQL", sql: rec.content }];
|
||||
if (Array.isArray(rec.ctes)) {
|
||||
const blocks = rec.ctes
|
||||
.map((c) => asRecord(c))
|
||||
|
||||
Reference in New Issue
Block a user