Documentation
¶
Overview ¶
Package analysis is the shape of an engine's answer about a query: the JSON `sqlc analyze` prints, so that a case's committed stdout.json can be compared with what the database itself reports, byte for byte.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Column ¶
type Column struct {
Name string `json:"name"`
Type *TypeExpr `json:"type,omitempty"`
Table string `json:"table,omitempty"`
}
Column describes a result column, or the column a parameter stands in for.
type Query ¶
type Query struct {
Name string `json:"name"`
Cmd string `json:"cmd"`
Columns []Column `json:"columns"`
Params []Param `json:"params"`
}
Query is what was found out about one query.
type TypeArg ¶
type TypeArg struct {
Label string `json:"label,omitempty"`
Type *TypeExpr `json:"type,omitempty"`
Int *int64 `json:"int,omitempty"`
Bool *bool `json:"bool,omitempty"`
String *string `json:"string,omitempty"`
Ident *string `json:"ident,omitempty"`
}
TypeArg is one argument of a TypeExpr: a type, an integer, a boolean, a quoted string, or an identifier — a bare word that is not a type, such as the function an AggregateFunction names.
type TypeExpr ¶
type TypeExpr struct {
Name string `json:"name"`
Nullable bool `json:"nullable,omitempty"`
Args []TypeArg `json:"args,omitempty"`
}
TypeExpr is a type as a call expression: a lowercased name applied to an ordered argument list, each argument another type, an integer, a boolean or a quoted string, optionally labelled. Nullability is an attribute of the type rather than a wrapper.