Documentation
¶
Overview ¶
Package schemaref finds the names a text qualifies with an application's schema (#2709): SQL such as "SELECT * FROM orders.invoices". Each of an application's environments runs in a schema of its own with the search path set to it, so a name written without the schema reads the environment's own table, and one qualified by the schema reaches that schema from every environment. Prepare removes the qualifier and the save gate refuses an edit that adds one; both read text through this one package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Script ¶
Script is a script's or a library's source with the schema qualifier removed from every string it holds, how many names that rewrote, and the libraries it loads. Only strings are read: a Starlark name that happens to be the schema's (orders.append) is code, not SQL. A source that does not parse names nothing.
func Unqualified ¶
Unqualified is text with every name qualified by one of schemas written without it, and how many it rewrote: each name where SQL names an object. A name inside a quoted SQL value is data and is left as written (Values lists it), as is a word that is not SQL.
Types ¶
type Name ¶
Name is one qualified name a source's string holds: the line of the string, the schema and the name it qualifies.
type Value ¶
type Value struct {
Line int `json:"line" example:"86"`
Text string `json:"text" example:"orders.invoices"`
}
Value is a qualified name inside a quoted SQL value: data, such as an outbox row's source table, which prepare leaves as written for a person to change, since the right text differs per environment.