Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidIdentifier = errors.New("Invalid identifier")
)
Functions ¶
func GenTemplate ¶
Types ¶
type Mutation ¶
type Mutation struct {
XMLName xml.Name `xml:"mutation"`
Name string `xml:"name,attr"`
InvalidateStr string `xml:"invalidate,attr"`
SQL SQLStmt `xml:"sql"`
}
Mutation are one of Insert/Update/Delete
func (Mutation) InvalidateQueries ¶
InvalidateQueries - query names
type NeedleConfig ¶
type NeedleConfig struct {
XMLName xml.Name `xml:"needle"`
Schema Schema `xml:"schema"`
Stmts Stmts `xml:"stmts"`
}
NeedleConfig the root structure of a needle xml config file
func ParseConfigFromFile ¶
func ParseConfigFromFile(path string) (*NeedleConfig, error)
ParseConfigFromFile -
type Query ¶
type Query struct {
XMLName xml.Name `xml:"query"`
Name string `xml:"name,attr"`
Type string `xml:"type,attr"`
CacheDurationStr string `xml:"cacheDuration,attr"`
SQL SQLStmt `xml:"sql"`
}
Query is the type of select statement.
func (Query) CacheDuration ¶
CacheDuration cache duration of query result. nil = nocache 0 time.Duration indicates cache forever.
func (Query) IsSingleRow ¶
IsSingleRow whether the result of query is single row or many row.
type Reference ¶
Reference is imported schemas. stmts like join may need stmts from others. SQL is set after importing from source.
type Schema ¶
type Schema struct {
HiddenFieldsStr string `xml:"hiddenFields,attr"`
Name string `xml:"name,attr"`
MainObj string `xml:"mainObj,attr"`
SQL SQLStmt `xml:"sql"`
Refs []Reference `xml:"ref"`
}
Schema schema of this config and imported sources.
func (Schema) HiddenFields ¶
HiddenFields return hidden fields of this schema.
Click to show internal directories.
Click to hide internal directories.