ast

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(r *AST, sourceFolder string) error

Normalize takes the raw ast from the parser and updates it state so it's ready to be rendered

Types

type AST

type AST struct {
	Entities []*Entity
}

func (*AST) FindEntity

func (a *AST) FindEntity(name string) (*Entity, error)

type Addition added in v0.19.3

type Addition struct {
	Left  Expression
	Right Expression
}

func (*Addition) Type added in v0.19.3

func (a *Addition) Type() Type

type Attribute

type Attribute struct {
	Name            string
	InverseName     string
	Identity        bool
	InverseIdentity bool
	Unique          bool
	AsType          Type
	Computed        Expression
}

func (*Attribute) Resolve

func (a *Attribute) Resolve() []ResolvedAttribute

func (*Attribute) Type

func (a *Attribute) Type() Type

type Attributes

type Attributes []*Attribute

func (Attributes) NoAuto

func (a Attributes) NoAuto() Attributes

func (Attributes) NoComputed added in v0.19.3

func (a Attributes) NoComputed() Attributes

func (Attributes) NoIDs

func (a Attributes) NoIDs() Attributes

func (Attributes) NoReferences

func (a Attributes) NoReferences() Attributes

func (Attributes) OnlyAuto

func (a Attributes) OnlyAuto() Attributes

func (Attributes) OnlyComputed added in v0.19.3

func (a Attributes) OnlyComputed() Attributes

func (Attributes) OnlyIDs

func (a Attributes) OnlyIDs() Attributes

func (Attributes) OnlyReferences

func (a Attributes) OnlyReferences() Attributes

func (Attributes) OnlyUnique

func (a Attributes) OnlyUnique() Attributes

func (Attributes) Resolve

func (a Attributes) Resolve() []ResolvedAttribute

type Bool

type Bool struct{}

func (*Bool) IsAuto

func (b *Bool) IsAuto() bool

func (*Bool) String

func (b *Bool) String() string

type Column added in v0.19.3

type Column struct {
	Entity *Entity
	Name   string
}

func (*Column) Type added in v0.19.3

func (c *Column) Type() Type

type Entity

type Entity struct {
	Name     string
	Comments []string
	IsView   bool
	// Entity is a CTE or equivalent
	IsQuery bool
	// Query string when the entity is a CTE
	Query     string
	Extension bool

	// Attributes are all attributes defined on this entity including ID
	Attributes Attributes

	InverseAttributes Attributes
}

func (*Entity) HasSerialInCompositeIdentity added in v0.19.2

func (e *Entity) HasSerialInCompositeIdentity() bool

func (*Entity) IsVirtual added in v0.26.0

func (e *Entity) IsVirtual() bool

func (*Entity) SerialInCompositeIdentity added in v0.19.2

func (e *Entity) SerialInCompositeIdentity() ResolvedAttribute

type Enum

type Enum struct {
	Name   string
	Values []EnumValue
}

func (*Enum) IsAuto

func (e *Enum) IsAuto() bool

func (Enum) MaxLength

func (e Enum) MaxLength() int

func (Enum) Short

func (e Enum) Short() string

func (*Enum) String

func (e *Enum) String() string

type EnumValue

type EnumValue struct {
	ID    string
	Value string
}

type Expression added in v0.19.3

type Expression interface {
	Type() Type
}

type Float

type Float struct{}

func (*Float) IsAuto

func (f *Float) IsAuto() bool

func (*Float) String

func (f *Float) String() string

type Int

type Int struct{}

func (*Int) IsAuto

func (i *Int) IsAuto() bool

func (*Int) String

func (i *Int) String() string

type Reference

type Reference struct {
	Entity *Entity
	// contains filtered or unexported fields
}

func MkReference

func MkReference(name string) *Reference

func (*Reference) IsAuto

func (r *Reference) IsAuto() bool

func (*Reference) String

func (r *Reference) String() string

type ResolvedAttribute

type ResolvedAttribute []*Attribute

func (ResolvedAttribute) Attribute

func (ra ResolvedAttribute) Attribute() *Attribute

func (ResolvedAttribute) Name

func (ra ResolvedAttribute) Name() string

func (ResolvedAttribute) Type

func (ra ResolvedAttribute) Type() Type

type Serial

type Serial struct{}

func (*Serial) IsAuto

func (s *Serial) IsAuto() bool

func (*Serial) String

func (s *Serial) String() string

type String

type String struct{}

func (*String) IsAuto

func (s *String) IsAuto() bool

func (*String) String

func (s *String) String() string

type StringLiteral added in v0.19.3

type StringLiteral struct {
	Value string
}

func (*StringLiteral) Type added in v0.19.3

func (s *StringLiteral) Type() Type

type Time

type Time struct{}

func (*Time) IsAuto

func (t *Time) IsAuto() bool

func (*Time) String

func (t *Time) String() string

type Type

type Type interface {
	IsAuto() bool
	String() string
}

Jump to

Keyboard shortcuts

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