mirror of
https://github.com/therootcompany/golib.git
synced 2026-04-24 12:48:00 +00:00
Apply the same lazy-error pattern fix to all backends, plus regression
tests that catch the bug.
pgmigrate is the confirmed-broken case (pgx/v5's Conn.Query is lazy and
surfaces 42P01 at rows.Err() once the prepared statement cache is primed).
The defensive check at rows.Err() is also added to mymigrate and msmigrate
in case their drivers exhibit similar behavior in some configurations.
litemigrate is refactored to probe sqlite_master with errors.Is(sql.ErrNoRows)
instead of string-matching the error message — SQLite returns the generic
SQLITE_ERROR code for "no such table" so a typed-error approach isn't
possible at the driver layer; the probe lets us use idiomatic errors.Is.
Tests:
- litemigrate: in-memory SQLite, runs on every go test (no infra)
- pgmigrate: PG_TEST_URL env-gated; verified against real Postgres,
TestAppliedAfterDropTable reproduces the agent's exact error
message ("reading rows: ... 42P01") without the fix
- mymigrate: MYSQL_TEST_DSN env-gated
- msmigrate: MSSQL_TEST_URL env-gated; verified against real SQL Server
Each backend has four cases: missing table, populated table, empty table,
and table-dropped-after-cache-primed (the lazy-error scenario).
46 lines
806 B
Plaintext
46 lines
806 B
Plaintext
credentials.tsv
|
|
|
|
.env
|
|
*.env
|
|
env.*
|
|
!example.env
|
|
|
|
# Project binaries
|
|
dist/
|
|
auth/csvauth/cmd/csvauth/csvauth
|
|
cmd/auth-proxy/auth-proxy
|
|
cmd/httplog/httplog
|
|
cmd/jsonl/jsonl
|
|
cmd/sendsms/sendsms
|
|
cmd/smsapid/smsapid
|
|
cmd/smsgwhookstocsv/smsgwhookstocsv
|
|
cmd/sql-migrate/sql-migrate
|
|
io/transform/gsheet2csv/cmd/gsheet2csv/gsheet2csv
|
|
io/transform/gsheet2csv/cmd/gsheet2env/gsheet2env
|
|
io/transform/gsheet2csv/cmd/gsheet2tsv/gsheet2tsv
|
|
|
|
# Binaries for programs and plugins
|
|
*.exe
|
|
*.exe~
|
|
*.dll
|
|
*.so
|
|
*.dylib
|
|
|
|
# Test binary, built with `go test -c`
|
|
*.test
|
|
|
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
*.out
|
|
|
|
# Dependency directories (remove the comment below to include it)
|
|
# vendor/
|
|
|
|
.DS_Store
|
|
|
|
# Agent session files
|
|
agents/TASKS.md
|
|
agents/REVIEW.md
|
|
agents/HANDOFF.md
|
|
agents/issues.d/
|
|
agents/tmp/
|