entity

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRawPath

func NewRawPath(filePath string, tagName string, dmlEnum enum.QueryEnum, conditions ...*Condition) *rawPath

func NewTxContext added in v1.1.1

func NewTxContext(ctx context.Context, tx *sqlx.Tx) context.Context

Types

type Case

type Case struct {
	CharData string
	Name     string
}

type CommonFields

type CommonFields struct {
	FilePath  string
	Name      string
	RawSql    string
	Parts     []*Part
	SimpleSql bool
}

func (*CommonFields) GetParts

func (q *CommonFields) GetParts() []*Part

func (*CommonFields) GetRawSql

func (q *CommonFields) GetRawSql() string

func (*CommonFields) IsSimpleSql

func (q *CommonFields) IsSimpleSql() bool

func (*CommonFields) Path

func (q *CommonFields) Path() string

func (*CommonFields) Tag

func (q *CommonFields) Tag() string

type Condition

type Condition struct {
	PartName string
	CaseName string
}

type DMLBody

type DMLBody struct {
	AbsFilePath string
	Selects     []*Select
	Inserts     []*Insert
	Deletes     []*Delete
	Updates     []*Update
}

type DbSet

type DbSet struct {
	Write *sqlx.DB
	Read  *sqlx.DB
}

type Delete

type Delete struct {
	*CommonFields
}

type DynamicQuery

type DynamicQuery struct {
	FilePath    string
	TagName     string
	Key         []*Condition
	DmlEnum     enum.QueryEnum
	SqlPartials []string
}

type Insert

type Insert struct {
	*CommonFields
}

type Part

type Part struct {
	Name     string
	CharData string
	Cases    []*Case
}

type Path

type Path struct {
	FilePath   string
	SqlTagName string
	DmlEnum    enum.QueryEnum
	Conditions string
}

type PredicateConditions

type PredicateConditions func() []*Condition

type QueryEntity

type QueryEntity interface {
	Path() string
	Tag() string
	GetRawSql() string
	GetParts() []*Part
	IsSimpleSql() bool
}

type QueryMap

type QueryMap struct {
	FilePath  string
	SelectMap map[string]*Select // key: filePath/SELECT/tagName value: *Select
	InsertMap map[string]*Insert // key: filePath/INSERT/tagName value: *Insert
	UpdateMap map[string]*Update // key: filePath/UPDATE/tagName value: *Update
	DeleteMap map[string]*Delete // key: filePath/DELETE/tagName value: *Delete
}

func (*QueryMap) FindQueryInDelete

func (m *QueryMap) FindQueryInDelete(tagName string) (*Delete, errors.Error)

func (*QueryMap) FindQueryInInsert

func (m *QueryMap) FindQueryInInsert(tagName string) (*Insert, errors.Error)

func (*QueryMap) FindQueryInSelect

func (m *QueryMap) FindQueryInSelect(tagName string) (*Select, errors.Error)

func (*QueryMap) FindQueryInUpdate

func (m *QueryMap) FindQueryInUpdate(tagName string) (*Update, errors.Error)

type Select

type Select struct {
	*CommonFields
}

type TxContext added in v1.1.1

type TxContext struct {
	context.Context
	*sqlx.Tx
}

type Update

type Update struct {
	*CommonFields
}

Jump to

Keyboard shortcuts

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