config

package
v0.0.0-...-6131656 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Global  Global  `json:"global"`
	Queries Queries `json:"queries"`

	Schema Schema `json:"-"`
}

func (*Config) Init

func (t *Config) Init(dbType atlas.DbType, schema *schema.Schema, filePath, fileName, packageName, className, doNotEdit string) error

func (*Config) Load

func (t *Config) Load(path string) error

TODO - 추후 config 형식 변경 예정

func (*Config) Save

func (t *Config) Save(path string) error

type CustomFieldType

type CustomFieldType struct {
	TableName  string `json:"table_name"`
	FieldName  string `json:"field_name"`
	CustomType string `json:"type"`
}

type Global

type Global struct {
	FilePath string `json:"file_path"`
	FileName string `json:"file_name"`

	DoNotEdit   string `json:"do_not_edit"`
	PackageName string `json:"package_name"`
	ClassName   string `json:"class_name"`

	Import []*Import `json:"import"`
}

type Import

type Import struct {
	Alias string `json:"alias"`
	Path  string `json:"path"`
}

type Queries

type Queries struct {
	Class map[string][]*Query `json:"class"` // auto generated by schema
	// contains filtered or unexported fields
}

func (*Queries) AddQuery

func (t *Queries) AddQuery(tableName string, query *Query)

func (*Queries) InitDefaultQueryTables

func (t *Queries) InitDefaultQueryTables() error

type Query

type Query struct {
	Name    string `json:"name"`
	Comment string `json:"comment,omitempty"`
	Sql     string `json:"sql"`

	// options
	CustomFieldTypes []*CustomFieldType `json:"custom_field_types,omitempty"`
	InsertMulti      bool               `json:"insert_multi,omitempty"`
	UpdateNullIgnore bool               `json:"update_null_ignore,omitempty"`
	ErrQuery         string             `json:"-"`
	ErrParser        string             `json:"-"`
}

func (*Query) AddCustomType

func (t *Query) AddCustomType(tableName, fieldName string, customType string)

func (*Query) GetCustomType

func (t *Query) GetCustomType(fieldName string) (genType string)

type Schema

type Schema struct {
	DbType atlas.DbType `json:"-"`

	*schema.Schema `json:"-"`
}

func (*Schema) GetFieldType

func (t *Schema) GetFieldType(tableName, fieldName string) (fieldType string, exist bool)

func (*Schema) GetFieldTypeAll

func (t *Schema) GetFieldTypeAll(fieldName string) (fieldTypeByTable map[string]string, exist bool)

func (*Schema) Init

func (t *Schema) Init(dbType atlas.DbType, sch *schema.Schema)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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