ext_mapper

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSql

func ParseSql(sql *XmlSQL, paramObj any) (string, []any, error)

Types

type ExtMapper

type ExtMapper struct {
	// contains filtered or unexported fields
}

func NewExtMapper

func NewExtMapper(tx *gorm.DB, xmlMapperData []byte) (*ExtMapper, error)

func (*ExtMapper) Delete

func (em *ExtMapper) Delete(sqlId string, paramObj any) error

func (*ExtMapper) GetAndParseSql

func (em *ExtMapper) GetAndParseSql(sqlId string, paramObj any) (string, []any, error)

func (*ExtMapper) GetSql

func (em *ExtMapper) GetSql(sqlId string) (*XmlSQL, error)

func (*ExtMapper) Insert

func (em *ExtMapper) Insert(sqlId string, paramObj any) error

func (*ExtMapper) Select

func (em *ExtMapper) Select(sqlId string, paramObj any, rx any) error

func (*ExtMapper) SetTx

func (em *ExtMapper) SetTx(tx *gorm.DB) *ExtMapper

func (*ExtMapper) Update

func (em *ExtMapper) Update(sqlId string, paramObj any) error

type XmlMapper

type XmlMapper struct {
	XmlName    xml.Name `xml:"mapper"`
	Namespace  string   `xml:"namespace,attr"`
	SelectSQLs []XmlSQL `xml:"select"`
	InsertSQLs []XmlSQL `xml:"insert"`
	UpdateSQLs []XmlSQL `xml:"update"`
	DeleteSQLs []XmlSQL `xml:"delete"`
	Id2Sql     map[string]*XmlSQL
}

func GetXmlMapper

func GetXmlMapper(xmlData []byte) (*XmlMapper, error)

type XmlSQL

type XmlSQL struct {
	XmlName xml.Name `xml:"sql"`
	ID      string   `xml:"id,attr"`
	Content string   `xml:",chardata"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳