dbml

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeInt   = "int"
	TypeUUID  = "uuid"
	TypeFloat = "float"
)

Variables

View Source
var (
	ColumnDefaultValueStringRegexp     = regexp.MustCompile(`^'(.*)'$`)
	ColumnDefaultValueExpressionRegexp = regexp.MustCompile("^`(.*)`$")
)

Functions

This section is empty.

Types

type Column

type Column struct {
	Name string
	Type string

	Settings ColumnSettings
}

func (*Column) AsNullable

func (c *Column) AsNullable()

func (*Column) Render

func (c *Column) Render() string

type ColumnDefault

type ColumnDefault struct {
	Type  ColumnDefaultType
	Value string
}

func (*ColumnDefault) Render

func (d *ColumnDefault) Render() string

type ColumnDefaultType

type ColumnDefaultType int
const (
	ColumnDefaultTypeNumber ColumnDefaultType = iota
	ColumnDefaultTypeString
	ColumnDefaultTypeExpression
	ColumnDefaultTypeBoolean
)

type ColumnSettings

type ColumnSettings struct {
	PrimaryKey bool
	Increment  bool
	Note       string
	Unique     bool
	Default    ColumnDefault
	// contains filtered or unexported fields
}

func (*ColumnSettings) Render

func (s *ColumnSettings) Render() string

type Enum

type Enum struct {
	Name   string
	Values []EnumValue
}

func (*Enum) Render

func (e *Enum) Render() string

type EnumValue

type EnumValue struct {
	Name string

	Settings EnumValueSettings
}

func (*EnumValue) Render

func (v *EnumValue) Render() string

type EnumValueSettings

type EnumValueSettings struct {
	Note string
}

func (*EnumValueSettings) Render

func (s *EnumValueSettings) Render() string

type File

type File struct {
	Tables []*Table
	Refs   []*Ref
	Enums  []*Enum
}

func (*File) Render

func (f *File) Render() string

type Ref

type Ref struct {
	From string
	Type string
	To   string
}

func (*Ref) Render

func (r *Ref) Render() string

type RelationSubject

type RelationSubject struct {
	Table  string
	Column string
}

func ParseRelationSubject

func ParseRelationSubject(subject string) (*RelationSubject, error)

type Table

type Table struct {
	Name    string
	Columns []*Column

	Note string
}

func (*Table) Render

func (t *Table) Render() string

Jump to

Keyboard shortcuts

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