Documentation
¶
Overview ¶
Package endtoend finds the analyze cases under internal/endtoend/testdata and compares an engine's own answer with the output a case committed, the way the dialect package compares a generated dialect with the committed one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Rewrite ¶
Rewrite replaces every parameter reference in a query — ?, sqlc.arg(name), sqlc.narg(name), sqlc.slice(name) and ClickHouse's {name:Type} — with what bind returns for it, in order of appearance, skipping string literals, quoted identifiers and comments. bind is handed the name, empty for a ?, and the word before the reference, so that a LIMIT or OFFSET can be bound differently from a value; the second count of a LIMIT ?, ? is handed LIMIT as well. Each engine decides what a reference becomes and how the references are numbered.
Types ¶
type Case ¶
type Case struct {
Name string // analyze_params/clickhouse
Dir string
Schema string
Query string
Fixture string // empty when the case has no fixture.sql
Output string
}
Case is one analyze case: the files sqlc analyze ran with, the fixture loaded before the queries run against a real database, and the output sqlc committed.
func Cases ¶
Cases lists the analyze cases for an engine: every analyze_*/<engine> directory whose exec.json runs the analyze command. A case that asks for the AST is skipped, since only sqlc can print that.