Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
85881b9
mysql/spike: MySQL's own grammar and lexer, cut out of the server sou…
kr9ly Sep 9, 2026
bfed5d6
mysql/spike: link the server's whole charset registry instead of a tw…
kr9ly Sep 9, 2026
a9f426b
design: the MySQL spike's verdicts — the THD shim closes at five poin…
kr9ly Sep 9, 2026
bdca02a
mysql/internal/parsegen: the spike's shell, sed and TypeScript become…
kr9ly Sep 9, 2026
70f188c
cmd/sqlshape is its own module at .../cmd/sqlshape/v2 under GPLv2, my…
kr9ly Sep 9, 2026
e65cffd
mysql/internal/mysqlparse: the Go side of the MySQL parser — the wasm…
kr9ly Sep 9, 2026
f3d8bb1
parsegen reads the semantic actions it strips — `$$= NEW_PTN PT_x(@$,…
kr9ly Sep 9, 2026
87974eb
mysql/internal/mysqlast: the CST folds into the server's own parse-tr…
kr9ly Sep 9, 2026
d22598f
parsegen names the AST: constructor parameter names from the server h…
kr9ly Sep 9, 2026
6382bce
mysqlast pays down the AST's debts: hooks bind by rule and right-hand…
kr9ly Sep 9, 2026
f2565b7
design: the MySQL analyzer reads mysqlast directly through generated …
kr9ly Sep 9, 2026
bed5020
mysqlast/views.go: parsegen generates a typed view per parse-tree cla…
kr9ly Sep 9, 2026
1e8933e
mysqlast: CREATE VIEW folds into one node from its legacy LEX pieces,…
kr9ly Sep 9, 2026
4706b21
mysqlast: DDL hooks (national and YEAR types, ALTER TABLE's action an…
kr9ly Sep 9, 2026
8f694a3
mysql/internal/schema: schema.sql for MySQL — CREATE TABLE with its c…
kr9ly Sep 9, 2026
8c39794
design: the mysqld oracle is a local tool for generating the catalog,…
kr9ly Sep 9, 2026
22a9aa5
mysql/internal/catalog: the function catalog read from the server sou…
kr9ly Sep 9, 2026
9ee2658
dialect: the seam between the checker and a database's analyzer, and …
kr9ly Sep 9, 2026
6bbff5a
release: one version for the three modules — cmd/sqlshape drops /v2 a…
kr9ly Sep 10, 2026
2cc815e
scripts/release.sh: one command releases the three modules — sets the…
kr9ly Sep 10, 2026
c657a1d
mysql/internal/analyze: the type rules as the server states them — ar…
kr9ly Sep 10, 2026
5d4d0e7
mysql/internal/oracle: a real mysqld as the ground truth for the type…
kr9ly Sep 10, 2026
56fc842
mysql: every registry function checked against the server — TestProbe…
kr9ly Sep 10, 2026
bfc4957
design: the line between dialects — features appear only as a dialect…
kr9ly Sep 10, 2026
c3ac9b0
CHANGELOG: the 1.3.0 section (the release candidate carries it; scrip…
kr9ly Sep 10, 2026
04a61a0
release: v1.3.0-rc.1
kr9ly Sep 10, 2026
e9d96c0
scripts/release.sh: tidy until nothing changes — tidy rewrote mysql/g…
kr9ly Sep 10, 2026
8dc78b4
scripts/release.sh: the sums recorded for a moved tag are dropped bef…
kr9ly Sep 10, 2026
e3cfdfa
release: v1.3.0-rc.2
kr9ly Sep 10, 2026
d70fc84
mysql/internal/analyze: subqueries, derived tables, views, CTEs, set …
kr9ly Sep 10, 2026
aebcd46
design: the checker is the product and the runtimes are per-database …
kr9ly Sep 10, 2026
d95199f
2.0: the checker is the product, the runtimes are per-database module…
kr9ly Sep 10, 2026
98fa494
scripts/release.sh: the require of a single-line require statement mo…
kr9ly Sep 10, 2026
9b1e0d3
2.0: every module path carries the /v2 major-version suffix Go requir…
kr9ly Sep 10, 2026
2192329
release: v2.0.0-rc.1
kr9ly Sep 10, 2026
81ea554
scripts/release.sh: the root tag is pushed last and alone — GitHub cr…
kr9ly Sep 10, 2026
b02b0cd
mysql, mysqltest: the MySQL runtime over database/sql — Run / Collect…
kr9ly Sep 10, 2026
2a3bc70
One on MySQL, proved on facts for every dialect — x/cardinality prove…
kr9ly Sep 10, 2026
09a226e
x/boundary_test.go: the layering checked on the import graph — x/* im…
kr9ly Sep 10, 2026
d70076b
x/obligation: the obligations leave check/postgres for x/, dialect-fr…
kr9ly Sep 10, 2026
134e09d
check/postgres/dialect: the PostgreSQL adapter to the neutral contrac…
kr9ly Sep 10, 2026
b02d6f3
vet reads PostgreSQL columns, parameters and sources through the cont…
kr9ly Sep 10, 2026
dc2a4b2
vet checks PostgreSQL through the contract's Analyzer — check/postgre…
kr9ly Sep 10, 2026
dd1e403
the bare ORDER BY / GROUP BY / PARTITION BY parameter is the PostgreS…
kr9ly Sep 10, 2026
8b424e6
vet is free of PostgreSQL: the schema side of the contract — x/dialec…
kr9ly Sep 10, 2026
d49d453
the One proof is x/cardinality's alone, over the facts, for every dia…
kr9ly Sep 10, 2026
f38c80f
the obligations and the failure modes reach MySQL through the contrac…
kr9ly Sep 10, 2026
455031a
the MySQL analyzer runs the server's ONLY_FULL_GROUP_BY checks (check…
kr9ly Sep 10, 2026
4239bd3
the MySQL analyzer reads a parenthesized join as a side of a join (PT…
kr9ly Sep 10, 2026
98df761
a MySQL placeholder carries the table column it stands for (Param.Sou…
kr9ly Sep 10, 2026
8e3f89e
the MySQL analyzer's last probe disagreements: REGEXP_LIKE is a bigin…
kr9ly Sep 10, 2026
3f338e8
docs: the checks page names MySQL (Part 3, both languages) -- the `--…
kr9ly Sep 10, 2026
a2875e5
MySQL after an adversarial round against a running mysqld (7 lanes, 2…
kr9ly Sep 10, 2026
724da79
the pinned-by-RAND() regression test asserts the checker's refusal; t…
kr9ly Sep 10, 2026
7cf25ef
the schema declares the server settings its judgments depend on: `-- …
kr9ly Sep 10, 2026
0284e04
PostgreSQL after a third adversarial round against a running server (…
kr9ly Sep 11, 2026
18fbd97
ON CONFLICT DO NOTHING without a conflict target takes every unique c…
kr9ly Sep 11, 2026
beca009
docs for a reader who uses one database. docs/postgres.md and docs/my…
kr9ly Sep 11, 2026
50b2b8a
MySQL migrations: sqlshape diff / apply / verify-schema work on a sch…
kr9ly Sep 11, 2026
2ff3042
MySQL: the script splitter reads a compound statement as one (a CREAT…
kr9ly Sep 13, 2026
6502dd5
MySQL loader: CREATE TRIGGER (timing, event, FOLLOWS / PRECEDES, the …
kr9ly Sep 13, 2026
220aa29
MySQL migrations read triggers and routines: dump renders them from S…
kr9ly Sep 13, 2026
6ed116b
MySQL: the checker reads trigger and routine bodies. AnalyzeTrigger /…
kr9ly Sep 13, 2026
5884a9b
mysql runtime: a SIGNAL raised by a trigger or routine comes back as …
kr9ly Sep 13, 2026
8771888
MySQL failure modes through triggers. A statement on a table takes th…
kr9ly Sep 13, 2026
8084202
MySQL: stored routine calls. A function the catalog does not know res…
kr9ly Sep 13, 2026
ca7a59a
docs for MySQL triggers and stored routines: mysql.md / mysql.ja.md g…
kr9ly Sep 13, 2026
c9e938c
The name a schema gives an error is mirrored in Go and checked both w…
kr9ly Sep 13, 2026
8bffa13
docs: the schema's error names and their Go declarations (checks.md b…
kr9ly Sep 13, 2026
19f7f84
vet: the docs' examples run. TestDocs re-reads the go / sql blocks of…
kr9ly Sep 13, 2026
34f7b39
vet: the rest of the docs' examples run. checks.md's Part 1 (aliases,…
kr9ly Sep 13, 2026
f110576
MySQL trigger / routine code covered line by line: tests for every re…
kr9ly Sep 13, 2026
7cde05b
MySQL: `-- sqlshape: not null` above a CREATE FUNCTION declares the f…
kr9ly Sep 13, 2026
5ccd22c
expand: a template that tests the same field twice ({{if .Status}} in…
kr9ly Sep 13, 2026
03d3b3a
PostgreSQL: a nested row's fields keep their nullability through a ca…
kr9ly Sep 13, 2026
fa67ffc
vet: a pointer parameter used inside the then branch of {{if .X}} / {…
kr9ly Sep 13, 2026
f380a00
docs catch up with the checker where the examples harness found them …
kr9ly Sep 13, 2026
1176a58
expand: a condition inside a range is decided per element: the tie of…
kr9ly Sep 13, 2026
8b28b6f
MySQL: an aggregate without GROUP BY proves one row wherever it sits …
kr9ly Sep 14, 2026
269f7b4
The contract can say an array's elements are never NULL, and MySQL's …
kr9ly Sep 14, 2026
98d8821
docs: lists and tables where prose was enumerating. flags.md / ja: th…
kr9ly Sep 14, 2026
a9c8cbf
MySQL: CREATE EVENT is read, analyzed and migrated. The AST gained ho…
kr9ly Sep 14, 2026
f6f6ef8
MySQL: ALTER EVENT is applied by the loader (each clause written repl…
kr9ly Sep 14, 2026
4728247
CHANGELOG: everything since v2.0.0-rc.1 folds into the [2.0.0] sectio…
kr9ly Sep 14, 2026
e99624a
The examples pass their own checker again: a view keeps the proof tha…
kr9ly Sep 14, 2026
6ecbe4d
release: v2.0.0-rc.2
kr9ly Sep 14, 2026
20a55af
MySQL after a second adversarial round against a running mysqld 8.4 (…
kr9ly Sep 15, 2026
5c173f9
MySQL migrations have an oracle: check/mysql/migrate's TestMigratePro…
kr9ly Sep 15, 2026
7074645
PostgreSQL migrations have the same oracle as MySQL's: check/postgres…
kr9ly Sep 15, 2026
1958600
Both migrate probes run against tables holding rows, with up to five …
kr9ly Sep 15, 2026
950f1dd
The migrate probes have a coverage unit and a third round of vocabula…
kr9ly Sep 16, 2026
0bdae9a
Partitions are migrated on both dialects instead of being noted (Post…
kr9ly Sep 16, 2026
01e4b52
The migrate probes close the holes their own oracle opened: a directe…
kr9ly Sep 16, 2026
d74a398
The migrate probes close the holes their own oracle opened. Coverage …
kr9ly Sep 16, 2026
bcc79c4
Partitions whose id is a bigserial or an identity column attach and d…
kr9ly Sep 16, 2026
dae6382
MySQL after a third adversarial round against a running mysqld 8.4 (t…
kr9ly Sep 16, 2026
f4a1afa
MySQL's third adversarial round, second half: every face the first ha…
kr9ly Sep 16, 2026
8b1b6b1
mysqltest puts a server's data directory on /dev/shm when it is writa…
kr9ly Sep 16, 2026
7a77bc7
Tests run in a quarter of the time (the longest package 328 s to 68 s…
kr9ly Sep 16, 2026
4e5ee79
MySQL reads the statements the third adversarial round could not meas…
kr9ly Sep 16, 2026
68cbed3
The statement facts get an oracle: x/factsprobe (root module, stdlib …
kr9ly Sep 16, 2026
e4d6980
The failure modes get the same oracle. x/factsprobe becomes x/stmtpro…
kr9ly Sep 16, 2026
7ba5263
MySQL routine and trigger bodies get the CREATE-time oracle. check/my…
kr9ly Sep 16, 2026
f2638b4
MySQL's own test corpus replays against mysqld and the analyzer side …
kr9ly Sep 16, 2026
e6b1e14
The MySQL corpus probe's second round: the baseline falls 4,605 -> 3,…
kr9ly Sep 17, 2026
ba1b92f
The MySQL corpus probe's third round: a literal the column can never …
kr9ly Sep 17, 2026
69e24bd
gofmt check/mysql/dialect/dialect_test.go and x/dialect/dialect.go (f…
kr9ly Sep 17, 2026
23f56a7
The MySQL corpus probe's fourth round, first half: a prefix key and a…
kr9ly Sep 17, 2026
7abd7e4
The MySQL corpus probe's fourth round, second half: the spatial types…
kr9ly Sep 17, 2026
931a859
The MySQL corpus probe's fifth round: constant arithmetic the server …
kr9ly Sep 18, 2026
c5e153d
The MySQL corpus probe's sixth round: the constant conversions a stri…
kr9ly Sep 19, 2026
0aec60d
The loader's unsupported constructs, filled: every statement a dumped…
kr9ly Sep 19, 2026
b6f9191
Writes through views, analyzed as the server runs them. A merged view…
kr9ly Sep 19, 2026
9aa2d6a
The MySQL corpus probe's seventh round: the scoped system variable re…
kr9ly Sep 19, 2026
19d74e4
The MySQL corpus probe's eighth round: the run-time failures a functi…
kr9ly Sep 19, 2026
19b6e6f
The docs' release pass: the CHANGELOG's 2.0.0 section reduced to the …
kr9ly Sep 19, 2026
1ad347f
CI runs the MySQL suite: the first pull_request run of the 2.0 branch…
kr9ly Sep 19, 2026
e52d65b
The CI run's two survivors. The migrate probe's "No space left on dev…
kr9ly Sep 19, 2026
8378c51
docs/mysql.ja.md、日本語として読めるように書き直す。内容は変えない。直訳調の見出し文(「文の形が一覧を変える」→「どの違反…
kr9ly Sep 19, 2026
5f7680b
Coverage accounts for the generators and their output the way it alwa…
kr9ly Sep 19, 2026
5787f7e
The MySQL loader's DDL branches, tested directly -- and the test's fi…
kr9ly Sep 19, 2026
820fa56
The dialect seam's dead weight cut, its untested promises pinned, and…
kr9ly Sep 19, 2026
94877f5
The predicate alternatives the shape reader could not follow, folded …
kr9ly Sep 19, 2026
6e9713c
Two mis-loads the uncovered code was hiding, and the dead weight arou…
kr9ly Sep 19, 2026
a873017
The row alias lands, the timing flake dies, and the view rule says it…
kr9ly Sep 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/scripts/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trap 'rm -f "$probe"' EXIT
cat > "$probe" <<'GO'
package tables

import "github.com/kr9ly/sqlshape"
import "github.com/kr9ly/sqlshape/v2"

var smoke = sqlshape.Query[int64, struct{}](`SELECT no_such_column FROM customers`)
GO
Expand Down
36 changes: 22 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Release: push a tag v* and this cross-compiles the sqlshape binary for every platform,
# packs it, and publishes a GitHub Release with checksums.
# Release: push the root tag vX.Y.Z and this cross-compiles the sqlshape binary for every
# platform, packs it, and publishes a GitHub Release with checksums.
#
# git tag v0.1.0 && git push origin v0.1.0
# scripts/release.sh v1.3.0 --push
#
# The repository's modules (the root, postgres, mysql, mysqltest, pgtest, check/postgres,
# check/mysql, cmd/sqlshape) release in lockstep: scripts/release.sh sets the inter-module requires to
# the version, commits, and tags vX.Y.Z and <module>/vX.Y.Z on that commit. Only the root
# tag triggers this workflow (the others do not start with "v").
#
# The binary is a plain Go build (libpg_query runs as WebAssembly, no cgo), so one runner
# builds every target; the smoke test runs the runner's own (linux/amd64) binary as a
# vettool over the examples, the only one it can execute.
#
# `go install github.com/kr9ly/sqlshape/cmd/sqlshape@<tag>` needs nothing from this
# workflow: it reads the tag straight from the module proxy.
# `go install github.com/kr9ly/sqlshape/cmd/sqlshape/v2@<version>` needs nothing from this
# workflow: it reads the tag cmd/sqlshape/<version> straight from the module proxy.
name: release

on:
Expand All @@ -27,6 +32,9 @@ jobs:
with:
go-version-file: go.mod

- name: Version
run: echo "VERSION=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"

- name: Build
env:
CGO_ENABLED: "0"
Expand All @@ -36,11 +44,11 @@ jobs:
goos=${target%/*}; goarch=${target#*/}
bin=sqlshape; [ "$goos" = windows ] && bin=sqlshape.exe
GOOS=$goos GOARCH=$goarch go build -trimpath \
-ldflags "-s -w -X github.com/kr9ly/sqlshape/internal/cli.version=${GITHUB_REF_NAME}" \
-ldflags "-s -w -X github.com/kr9ly/sqlshape/cmd/sqlshape/v2/internal/cli.version=${VERSION}" \
-o "build/$goos-$goarch/$bin" ./cmd/sqlshape
name="sqlshape_${GITHUB_REF_NAME}_${goos}_${goarch}"
name="sqlshape_${VERSION}_${goos}_${goarch}"
mkdir "$name"
cp "build/$goos-$goarch/$bin" LICENSE NOTICE README.md "$name"/
cp "build/$goos-$goarch/$bin" cmd/sqlshape/LICENSE check/postgres/NOTICE README.md "$name"/
if [ "$goos" = windows ]; then
zip -qr "dist/$name.zip" "$name"
else
Expand All @@ -51,7 +59,7 @@ jobs:
ls -la dist

- name: Smoke test
run: .github/scripts/smoke.sh ./build/linux-amd64/sqlshape "$GITHUB_REF_NAME"
run: .github/scripts/smoke.sh ./build/linux-amd64/sqlshape "$VERSION"

- name: Checksums
run: cd dist && sha256sum sqlshape_* > checksums.txt
Expand All @@ -61,14 +69,14 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
pre=""
case "$GITHUB_REF_NAME" in *-*) pre="--prerelease" ;; esac # v1.0.0-rc.1
# the release notes are the tag's section of CHANGELOG.md (a candidate v1.1.0-rc.1 reads
# the 1.1.0 section); generated notes when it has none
v="${GITHUB_REF_NAME#v}"; v="${v%%-*}"
case "$VERSION" in *-*) pre="--prerelease" ;; esac # v1.3.0-rc.1
# the release notes are the version's section of CHANGELOG.md (a candidate v1.3.0-rc.1
# reads the 1.3.0 section); generated notes when it has none
v="${VERSION#v}"; v="${v%%-*}"
awk -v v="$v" '/^## \[/ { on = index($0, "[" v "]") > 0; next } on' CHANGELOG.md > notes.md
notes="--generate-notes"
if grep -q . notes.md; then notes="--notes-file notes.md"; fi
gh release create "$GITHUB_REF_NAME" dist/* \
--repo "$GITHUB_REPOSITORY" \
--title "$GITHUB_REF_NAME" \
--title "sqlshape $VERSION" \
$notes $pre
73 changes: 59 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,18 @@ permissions:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 45
steps:
- uses: actions/checkout@v4

# the run boots real PostgreSQL and MySQL servers and initializes databases by the
# hundred; the stock runner's free disk fills up mid-run (TestMigrateProbe died on
# "No space left on device"), so the preinstalled toolchains this job never uses go
- name: Free disk space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
df -h /

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand All @@ -32,33 +41,69 @@ jobs:
/usr/lib/postgresql/17/bin/pg_dump --version

# the embedded PostgreSQL archive, its extracted binaries + initialized template data
# directory (internal/oracle), and PostgreSQL's regression corpus (TestRegress)
# directory (check/postgres/oracle), and PostgreSQL's regression corpus (TestRegress)
- name: Cache PostgreSQL binaries and regress corpus
uses: actions/cache@v4
with:
path: |
~/.embedded-postgres-go
~/.cache/sqlshape
key: sqlshape-pg-${{ hashFiles('internal/oracle/oracle.go', 'internal/analyze/testdata/tools/fetch-regress.sh') }}
key: sqlshape-pg-${{ hashFiles('check/postgres/oracle/oracle.go', 'check/postgres/analyze/testdata/tools/fetch-regress.sh') }}

- name: Fetch regress corpus
run: internal/analyze/testdata/tools/fetch-regress.sh
run: check/postgres/analyze/testdata/tools/fetch-regress.sh

# the MySQL tests boot the mysqld on PATH, and it must be 8.4 (the analyzer's measured
# version; the runner's own 8.0 is also AppArmor-confined and cannot write a data
# directory under $HOME). The official minimal tarball runs unconfined from $HOME.
- name: Cache MySQL 8.4
uses: actions/cache@v4
with:
path: ~/mysql-8.4.11
key: sqlshape-mysql-8.4.11-minimal

- name: Install MySQL 8.4
run: |
sudo apt-get install -y -q libaio1t64 libnuma1
# the tarball's mysqld links libaio.so.1; Ubuntu 24.04 ships it as libaio.so.1t64
sudo ln -sf /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
if [ ! -x "$HOME/mysql-8.4.11/bin/mysqld" ]; then
curl -fsSL -o /tmp/mysql.tar.xz https://cdn.mysql.com/Downloads/MySQL-8.4/mysql-8.4.11-linux-glibc2.28-x86_64-minimal.tar.xz
tar -xJf /tmp/mysql.tar.xz -C "$HOME"
mv "$HOME/mysql-8.4.11-linux-glibc2.28-x86_64-minimal" "$HOME/mysql-8.4.11"
rm /tmp/mysql.tar.xz
fi
echo "$HOME/mysql-8.4.11/bin" >> "$GITHUB_PATH"
"$HOME/mysql-8.4.11/bin/mysqld" --version

# the binary as users run it: as a vettool over the examples
- name: Smoke test
run: go build -o sqlshape ./cmd/sqlshape && .github/scripts/smoke.sh ./sqlshape

# coverage counts every package except the catalog generator (a manual tool run
# against a PostgreSQL) and the 5-statement main; the generated protobuf node types
# (internal/pgparse/pg_query.pb.go, 40k lines of accessors) are dropped from the profile.
# coverage counts every package except the generators, which are manual tools run
# against a server or its source (check/postgres/catalog/gen, check/mysql's parsegen)
# and the 5-statement main; generated data tables are dropped from the profile the way
# the protobuf node types (check/postgres/pgparse/pg_query.pb.go, 40k lines of
# accessors) are: mysqlast/views.go, mysqlparse's shapes.go / kinds.go and the
# catalog's functions.go / sysvars.go, all written by parsegen from the server source.
# -count=1: a cached test result replays the profile it recorded, with block positions
# from the sources of that run; after an edit to a package the cached package does not
# depend on, the stale blocks no longer line up and the merged total drops by ten points
- name: Test
# the test servers put their data directories on /dev/shm by default; the runner's
# tmpfs (RAM/2) is too small for the parallel suite ("No space left on device"), so
# both escape hatches point at the disk, which the free-space step cleared
env:
SQLSHAPE_ORACLE_DIR: ${{ runner.temp }}
SQLSHAPE_MYSQLTEST_DIR: ${{ runner.temp }}
run: |
pkgs=$(go list ./... | grep -v -e /internal/catalog/gen -e /cmd/sqlshape | paste -sd,)
go test ./... -count=1 -coverpkg="$pkgs" -coverprofile=cover.out -timeout 20m
grep -v '/pg_query\.pb\.go:' cover.out > cover.filtered && mv cover.filtered cover.out
# ./... is the root module; the other modules of the workspace are named one by one
# the exclusions name path segments, not full paths, so the /v2/ in the module
# paths cannot silently defeat them (it did: /check/postgres/catalog/gen matched
# nothing once the paths carried /v2/)
pkgs=$(go list ./... ./postgres/... ./mysql/... ./mysqltest/... ./pgtest/... ./cmd/sqlshape/... ./check/postgres/... ./check/mysql/... | grep -v -e /catalog/gen -e /internal/parsegen | paste -sd,)
go test ./... ./postgres/... ./mysql/... ./mysqltest/... ./pgtest/... ./examples/... ./cmd/sqlshape/... ./check/postgres/... ./check/mysql/... -count=1 -coverpkg="$pkgs" -coverprofile=cover.out -timeout 40m
grep -v -e '/pg_query\.pb\.go:' -e '/mysqlast/views\.go:' -e '/mysqlparse/shapes\.go:' -e '/mysqlparse/kinds\.go:' -e '/internal/catalog/functions\.go:' -e '/internal/catalog/sysvars\.go:' cover.out > cover.filtered && mv cover.filtered cover.out

# coverage badge: statement coverage of the whole module, committed as an SVG so the
# README can show it without a third-party service; --min makes it a regression gate
Expand Down Expand Up @@ -91,14 +136,14 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/sqlshape
key: sqlshape-pg18-${{ hashFiles('internal/oracle/oracle.go', 'internal/analyze/testdata/tools/fetch-regress.sh') }}
key: sqlshape-pg18-${{ hashFiles('check/postgres/oracle/oracle.go', 'check/postgres/analyze/testdata/tools/fetch-regress.sh') }}

- name: Fetch regress corpus
run: internal/analyze/testdata/tools/fetch-regress.sh REL_18_3
run: check/postgres/analyze/testdata/tools/fetch-regress.sh REL_18_3

- name: Test
env:
SQLSHAPE_PG: "18"
run: |
go test ./internal/catalog ./internal/oracle -count=1
go test ./internal/analyze -run 'TestRegress$' -count=1 -v -timeout 25m 2>&1 | grep -E 'statements:|hits|PASS|FAIL|ok '
go test ./check/postgres/catalog ./check/postgres/oracle -count=1
go test ./check/postgres/analyze -run 'TestRegress$' -count=1 -v -timeout 25m 2>&1 | grep -E 'statements:|hits|PASS|FAIL|ok '
Loading
Loading