supabase db advisors fails when executing the embedded local lint SQL.
Tagging @Rodriguespn since the original advisors implementation came from commit 43ce0a6a.
Repro
Run the command against a local database with an explicit Postgres URL:
go run . db advisors --db-url 'postgresql://postgres:postgres@127.0.0.1:55322/postgres?sslmode=disable' --debug
Actual Behavior
The command connects successfully, starts a transaction, and then fails when executing the embedded lint SQL:
ERROR: cannot insert multiple commands into a prepared statement (SQLSTATE 42601)
The debug trace points at internal/db/advisors/advisors.go in the tx.Query(ctx, lintsSQL) path.
Root Cause
lintsSQL begins with a separate session statement:
set local search_path = '';
That setup statement and the actual lint query are bundled together and sent through the prepared-statement path, which Postgres rejects.
Expected Behavior
supabase db advisors should execute the session setup and the lint query successfully against a local database.
Suggested Fix
Split the session setup from the lint query, for example:
tx.Exec(ctx, "set local search_path = ''")
tx.Query(ctx, <remaining lint query>)