Documentation
¶
Overview ¶
Package sqlitesrc manages the pinned SQLite release that meyer is tested against. It downloads the official artifacts, verifies their checksums, compiles the oracle program, and unpacks the test scripts.
The pin lives here so that every command shares one version, and the artifacts live in a cache directory (.sqlite/ by default, gitignored) that is reused across runs.
Index ¶
Constants ¶
const (
Version = "3530400" // 3.53.4
)
The pinned SQLite release. When advancing the pin, update all four constants and parser/testdata/README.md, regenerate the corpus, and review the diff.
Variables ¶
This section is empty.
Functions ¶
func FuzzSeeds ¶
FuzzSeeds returns the SQL fuzz inputs SQLite ships in test/fuzzdata*.db: tens of thousands of strings that have broken a SQLite parser at some point. PLAN.md wants them as fuzz seeds rather than vendored, so they are read out through the oracle on demand. They are a very different input distribution from anything a mutation of valid SQL produces.
func Oracle ¶
Oracle returns the path to the compiled oracle binary, downloading the pinned amalgamation and building it on first use.
func SplitDiffers ¶
SplitDiffers reports whether Run would cut a script into statements somewhere the tokenizer would not, which makes its verdict incomparable with a parser's.
The oracle splits the way the sqlite3 shell does, with sqlite3_complete, whose scanner is much cruder than the tokenizer: it understands strings, the four quoting styles and comments, but nothing else. So a ";" ends a statement for it even inside brackets, and even inside a token the real tokenizer would have swallowed whole -- ":v(a;b)" is one bind parameter to the tokenizer and two statements to sqlite3_complete. Any caller of Run inherits this, which is why it lives here rather than in one of them.
func TestScripts ¶
TestScripts returns the directory holding the pinned release's test/*.test scripts, downloading and unpacking them on first use.
Types ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner drives one long-lived oracle process in batch mode. Starting a process per script costs more than classifying one, which matters when a caller checks tens of thousands of small inputs; a Runner amortises it away. Runners are not safe for concurrent use — start one per worker.