model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 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 `` /* 133-byte string literal not displayed */
	End   string `json:"end,omitempty" yaml:"end,omitempty" jsonschema:"description=The end marker for code block,example=@gencoder.block.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            `` /* 130-byte string literal not displayed */
	OutputMarker  string            `` /* 162-byte string literal not displayed */
	BlockMarker   BlockMarker       `` /* 131-byte string literal not displayed */
	Databases     []*DatabaseConfig `json:"databases,omitempty" yaml:"databases,omitempty" jsonschema:"description=The list of databases"`
	Properties    map[string]string `` /* 159-byte string literal not displayed */
	Output        string            `` /* 130-byte string literal not displayed */
	Helpers       []string          `json:"helpers,omitempty" yaml:"helpers,omitempty" jsonschema:"description=The list of helper JavaScript files"`
	ImportHelpers []string          `` /* 156-byte string literal not displayed */
}

func (Config) GetHelpers added in v0.1.1

func (c Config) GetHelpers() []string

GetHelpers returns the merged list of helpers, prioritizing the new Helpers field

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,omitempty" yaml:"name,omitempty" jsonschema:"description=The name of the database,example=mydb"`
	Dsn        string            `` /* 271-byte string literal not displayed */
	Schema     string            `json:"schema,omitempty" yaml:"schema,omitempty" jsonschema:"description=The schema of the database,example=public"`
	Properties map[string]string `json:"properties,omitempty" yaml:"properties,omitempty" jsonschema:"description=Properties specific to the database"`
	Tables     []*TableConfig    `json:"tables,omitempty" yaml:"tables,omitempty" jsonschema:"description=The list of tables in the database"`
}

type File added in v0.0.5

type File struct {
	Name         string
	RelativePath string
	Content      []byte
	Type         FileType
	Output       string     // for Template FileType
	Template     goja.Value // for Template/Partial FileType
}

type FileType added in v0.0.5

type FileType int
const (
	FileTypeNormal FileType = iota
	FileTypePartial
	FileTypeTemplate
)

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,omitempty" yaml:"schema,omitempty" jsonschema:"description=The schema of the table,example=public"`
	Name          string            `json:"name,omitempty" yaml:"name,omitempty" jsonschema:"description=The name of the table,example=user,required"`
	Properties    map[string]string `json:"properties,omitempty" yaml:"properties,omitempty" jsonschema:"description=Properties specific to the table"`
	IgnoreColumns []string          `` /* 133-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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