qdb

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

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

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 NewQueries

func NewQueries(db *sql.DB) (ret *Query, err error)

func (*Query) ActivateDomains

func (q *Query) ActivateDomains(name string) (retEnds, retBegins []string, err error)

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) FieldsOf

func (q *Query) FieldsOf(kind string) (ret []query.FieldData, err error)

func (*Query) IsDomainActive

func (q *Query) IsDomainActive(name string) (okay bool, err error)

func (*Query) KindOfAncestors

func (q *Query) KindOfAncestors(kind string) (ret []string, err error)

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) NounInfo

func (q *Query) NounInfo(name string) (ret query.NounInfo, err error)

given a name, find a noun ( and some useful other context )

func (*Query) NounName

func (q *Query) NounName(id string) (ret string, err error)

return the best "short name" for a noun ( or blank if the noun isnt known or isnt in scope )

func (*Query) NounNames

func (q *Query) NounNames(id string) (ret []string, err error)

func (*Query) NounValues

func (q *Query) NounValues(id, field string) (ret []query.ValueData, err error)

interpreting the value is left to the caller ( re: field affinity ) returns pairs of path, (marshaled) value

func (*Query) NounsByKind

func (q *Query) NounsByKind(kind string) ([]string, error)

func (*Query) PatternLabels

func (q *Query) PatternLabels(pat string) (ret []string, err error)

the last value is always the result, blank for execute statements

func (*Query) PluralFromSingular

func (q *Query) PluralFromSingular(singular string) (string, error)

func (*Query) PluralToSingular

func (q *Query) PluralToSingular(plural string) (string, error)

func (*Query) ReadChecks

func (q *Query) ReadChecks(actuallyJustThisOne string) (ret []query.CheckData, err error)

read all the matching tests from the db.

func (*Query) ReciprocalsOf

func (q *Query) ReciprocalsOf(rel, id string) ([]string, error)

func (*Query) Relate

func (q *Query) Relate(rel, noun, otherNoun string) (err error)

func (*Query) RelativesOf

func (q *Query) RelativesOf(rel, id string) ([]string, error)

func (*Query) RulesFor

func (q *Query) RulesFor(pat string) (ret []query.RuleData, err error)

Jump to

Keyboard shortcuts

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