Documentation ¶
Overview ¶
Package qdb asks specific questions of the play.db for the package qna runtime. It relies on the model.sql and run.sql sqlite tables that are written to by package asm.
Index ¶
- type Query
- func (q *Query) ActivateDomains(name string) (retEnds, retBegins []string, err error)
- func (q *Query) FieldsOf(kind string) (ret []query.FieldData, err error)
- func (q *Query) IsDomainActive(name string) (okay bool, err error)
- func (q *Query) KindOfAncestors(kind string) (ret []string, err error)
- func (q *Query) NounInfo(name string) (ret query.NounInfo, err error)
- func (q *Query) NounName(id string) (ret string, err error)
- func (q *Query) NounNames(id string) (ret []string, err error)
- func (q *Query) NounValues(id, field string) (ret []query.ValueData, err error)
- func (q *Query) NounsByKind(kind string) ([]string, error)
- func (q *Query) PatternLabels(pat string) (ret []string, err error)
- func (q *Query) PluralFromSingular(singular string) (string, error)
- func (q *Query) PluralToSingular(plural string) (string, error)
- func (q *Query) ReadChecks(actuallyJustThisOne string) (ret []query.CheckData, err error)
- func (q *Query) ReciprocalsOf(rel, id string) ([]string, error)
- func (q *Query) Relate(rel, noun, otherNoun string) (err error)
- func (q *Query) RelativesOf(rel, id string) ([]string, error)
- func (q *Query) RulesFor(pat string) (ret []query.RuleData, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Read various data from the play database.
func (*Query) ActivateDomains ¶
changing domains can establish new relations ( abandoning now conflicting ones ) and cause nouns to fall out of scope returns the previous domain name
func (*Query) KindOfAncestors ¶
returns the ancestor hierarchy, starting with the kind itself. empty if the kind doesnt exist, errors on a db error. accepts both the plural and singular kind.
func (*Query) NounName ¶
return the best "short name" for a noun ( or blank if the noun isnt known or isnt in scope )
func (*Query) NounValues ¶
interpreting the value is left to the caller ( re: field affinity ) returns pairs of path, (marshaled) value
func (*Query) PatternLabels ¶
the last value is always the result, blank for execute statements
func (*Query) PluralFromSingular ¶
func (*Query) ReadChecks ¶
read all the matching tests from the db.