sqlz

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 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 QuerySql

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

func (*QuerySql) QueryAny

func (d *QuerySql) QueryAny(name string) (query string, err error)

QueryAny

@Usage
query, _ := zeroSql.Get("name").QueryAny("create-users-table")
fmt.Println(query)

type ZeroSql

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

func Load

func Load(sqlFile string) (*ZeroSql, error)

func (ZeroSql) Get

func (d ZeroSql) Get(match string) *QuerySql

func (*ZeroSql) LookupQuery

func (d *ZeroSql) LookupQuery(name string) (query string, err error)

LookupQuery

@Description: query the sql by the name commit
@param name like "create-user"
@Usage
zeroSql, _ := Load(filepath)
zeroSql.LookupQuery("create-user")	// default by "name"
if SetTag("tag"), then only return the result of startsWith the match "tag"

func (*ZeroSql) LookupQueryAny

func (d *ZeroSql) LookupQueryAny(name string) (query string, err error)

LookupQueryAny

@Usage
zeroSql, _ := Load(filepath)
zeroSql.LookupQueryAny("create-user")	// default by any match

func (*ZeroSql) PrintResult

func (d *ZeroSql) PrintResult()

PrintResult

@return print the map result in the console.

func (*ZeroSql) SetTag

func (d *ZeroSql) SetTag(match string)

SetTag

@Description: filter the result by match, only return the result of startsWith the match.
@param match like "name", "type", "tag" and so on.
@Usage
zeroSql, _ := Load(filepath)
zeroSql.SetTag("type")
zeroSql.LookupQuery("create-user")

Jump to

Keyboard shortcuts

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