config

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DryRun bool = false

命令行参数[-d]空转,仅输出sql文本

View Source
var LiquigoVersion string = "0.2.17"

liquigo版本号

View Source
var Version bool = false

命令行参数[-v]显示版本号(utils.LIQUIGO_VERSION)

View Source
var XormLog bool = false

命令行参数[-x]显示中间件xorm的Debug信息

View Source
var YamlConfig string = "app.yml"

默认的yaml配置文件

Functions

func GetChangeSets

func GetChangeSets(changeSetXmlFile string) ([]*etree.Element, error)

获取一个changeSetXml配置文件中全部changeSet changeSetXmlFile string changeSetXmlFile文件名称

Types

type DB

type DB struct {
	EntryXml       []string `yaml:"entry-xml,flow"`
	DriverName     string   `yaml:"driver-name"`
	DataSourceName string   `yaml:"data-source-name"`
	DbmsName       string   `yaml:"dbms-name"`
	DbmsVersion    string   `yaml:"dbms-version"`
}

entry-xml: [entry-xxxx-app01.xml] driver-name: sqlite data-source-name: D:\dev\learn\db dbms-name: sqlite dbms-version: 3

func GetYamlConfig

func GetYamlConfig(yamlfile string) ([]DB, error)

获取app.yml配置 yamlfile string 配置文件名称

type EntryXml

type EntryXml struct {
	XMLName    xml.Name   `xml:"databaseChangeLog"`
	Properties []Property `xml:"property"`
	Include    []Include  `xml:"include"`
}

entry-xxxx-app01.xml <databaseChangeLog ..>

<property name="date" value="datetime" dbms="mysql" />
...
<include file="classpath:db/app01/db-app01-ddl.xml" />
...

</databaseChangeLog>

var EntryXmlConfig EntryXml

本地保留一份配置实例供全局使用

func GetEntryXmlConfig

func GetEntryXmlConfig(xmlFile *string) (EntryXml, error)

获取entry入口文件配置 xmlFile *string 入口文件名称

type Include

type Include struct {
	File string `xml:"file,attr"`
}

<include file="classpath:db/app01/db-app01-ddl.xml" />

type Property

type Property struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
	Dbms  string `xml:"dbms,attr"`
}

<property name="date" value="datetime" dbms="mysql" />

type Yaml

type Yaml struct {
	DB []DB `yaml:"db,flow"`
}

app.yml

Jump to

Keyboard shortcuts

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