model

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockMarker

type BlockMarker struct {
	Start string `json:"start" yaml:"start"`
	End   string `json:"end" yaml:"end"`
}

func (BlockMarker) GetEnd

func (e BlockMarker) GetEnd() string

func (BlockMarker) GetStart

func (e BlockMarker) GetStart() string

type BuildInfo

type BuildInfo struct {
	Version string
}

type Column

type Column struct {
	Name         string  `json:"name" yaml:"name"`
	Ordinal      int     `json:"ordinal" yaml:"ordinal"`
	Type         string  `json:"type" yaml:"type"`
	IsNullable   bool    `json:"isNullable" yaml:"isNullable"`
	DefaultValue *string `json:"defaultValue" yaml:"defaultValue"`
	IsPrimaryKey bool    `json:"isPrimaryKey" yaml:"isPrimaryKey"`
	Comment      *string `json:"comment" yaml:"comment"`
}

type Config

type Config struct {
	Templates    string            `json:"templates" yaml:"templates"` // Can be a directory or URL
	OutputMarker string            `json:"outputMarker" yaml:"outputMarker"`
	BlockMarker  BlockMarker       `json:"blockMarker" yaml:"blockMarker"`
	Databases    []*DatabaseConfig `json:"databases" yaml:"databases"`
	Properties   map[string]string `json:"properties" yaml:"properties"`
}

func (Config) GetOutputMarker

func (c Config) GetOutputMarker() string

func (Config) GetTemplates

func (c Config) GetTemplates() string

type DatabaseConfig

type DatabaseConfig struct {
	Name       string            `json:"name" yaml:"name"`
	Dsn        string            `json:"dsn" yaml:"dsn"`
	Schema     string            `json:"schema" yaml:"schema"`
	Properties map[string]string `json:"properties" yaml:"properties"`
	Tables     []*TableConfig    `json:"tables" yaml:"tables"`
}

type GlobalOptions

type GlobalOptions struct {
	Config string `json:"config" yaml:"config"` // Where to read gencoder.yaml
}

type Index

type Index struct {
	Name      string         `json:"name" yaml:"name"`
	IsUnique  bool           `json:"isUnique" yaml:"isUnique"`
	IsPrimary bool           `json:"isPrimary" yaml:"isPrimary"`
	Columns   []*IndexColumn `json:"columns" yaml:"columns"`
}

type IndexColumn

type IndexColumn struct {
	Ordinal int    `json:"ordinal" yaml:"ordinal"`
	Name    string `json:"name" yaml:"name"`
}

type RenderContext

type RenderContext struct {
	Table          *Table            `json:"table" yaml:"table"`
	Properties     map[string]string `json:"properties" yaml:"properties"` // Merged properties
	Config         *Config           `json:"config" yaml:"config"`
	DatabaseConfig *DatabaseConfig   `json:"databaseConfig" yaml:"databaseConfig"`
	TableConfig    *TableConfig      `json:"tableConfig" yaml:"tableConfig"`
}

type Table

type Table struct {
	Name    string    `json:"name" yaml:"name"`
	Schema  string    `json:"schema" yaml:"schema"`
	Comment string    `json:"comment" yaml:"comment"`
	Columns []*Column `json:"columns" yaml:"columns"`
	Indexes []*Index  `json:"indexes" yaml:"indexes"`
}

type TableConfig

type TableConfig struct {
	Schema        string            `json:"schema" yaml:"schema"`
	Name          string            `json:"name" yaml:"name"`
	Properties    map[string]string `json:"properties" yaml:"properties"`
	IgnoreColumns []string          `json:"ignoreColumns" yaml:"ignoreColumns"`
}

type Tpl

type Tpl struct {
	TemplateName      string     // template file name
	GeneratedFileName string     // generated file name, if empty, it's a partial template
	Source            string     // template source code
	Template          goja.Value // compiled template
}

Jump to

Keyboard shortcuts

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