visualization

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphToPUMLDigraph

func GraphToPUMLDigraph(graph Graph, writer io.Writer) error

func MustWritePUML

func MustWritePUML(expression pgsql.Expression, path string)

func WriteStrings

func WriteStrings(writer io.Writer, strings ...string) error

Types

type Graph

type Graph struct {
	Title         string         `json:"-"`
	Style         Style          `json:"style"`
	Nodes         []Node         `json:"nodes"`
	Relationships []Relationship `json:"relationships"`
}

func SQLToDigraph

func SQLToDigraph(node pgsql.SyntaxNode) (Graph, error)

type Node

type Node struct {
	Caption    string         `json:"caption"`
	ID         string         `json:"id"`
	Labels     []string       `json:"labels"`
	Properties map[string]any `json:"properties"`
	Position   Position       `json:"position"`
	Style      Style          `json:"style"`
}

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

type Relationship

type Relationship struct {
	ID         string         `json:"id"`
	FromID     string         `json:"fromId"`
	ToID       string         `json:"toId"`
	Type       string         `json:"type"`
	Properties map[string]any `json:"properties"`
	Style      Style          `json:"style"`
}

type SQLVisualizer

type SQLVisualizer struct {
	walk.Visitor[pgsql.SyntaxNode]

	Graph Graph
	// contains filtered or unexported fields
}

func (*SQLVisualizer) Enter

func (s *SQLVisualizer) Enter(node pgsql.SyntaxNode)

func (*SQLVisualizer) Exit

func (s *SQLVisualizer) Exit(node pgsql.SyntaxNode)

type Style

type Style struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL