Help us shape the future of Go! Take the 2026 Go Developer Survey

refs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package refs answers one question about a query: which relations does it READ. That is all dependency inference needs, and it is deliberately less than a parser knows.

WHY NOT A PARSER. The spike behind #58 measured five, against official parsers as the oracle. memefish parsed 6 of 447 real BigQuery statements; go-pgquery is the Postgres oracle and weighs 14 MB with 70 packages; cockroachdb-parser is 37 MB and does not build without cgo. This reads 99.3% of 1,543 fresh Postgres statements and 26 of 26 fresh BigQuery, in 1.9 MB with nothing outside the standard library.

WHAT IT CANNOT DO, so nobody discovers it as a bug: `(TABLE x)` forms, uncommon clause keywords that take a relation-looking name, and anything that builds its SQL at runtime. A model that hits one declares the edge with `depends_on:` in its header, which is why that field exists.

The thirty cases in testdata were labelled by hand BEFORE any candidate ran, and the extractor was written afterwards -- so passing them is not evidence that it works, it is the floor that says it has not regressed. The evidence is in spikes/sql-parser/VERDICT.md, against SQL nobody chose.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Of

func Of(dialect, sql string) ([]string, error)

Of lists the relations a query reads, in the order they appear.

Types

This section is empty.

Jump to

Keyboard shortcuts

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