Repository navigation
Conversation
psteinroe
force-pushed
the
fix/execute-statement-results
branch
from
October 19, 2026 12:33
7ffd18b to
03d0003
Compare
…xplain why it is disabled
…ion string instead of panicking
psteinroe
force-pushed
the
fix/execute-statement-results
branch
from
October 20, 2026 07:36
03d0003 to
54744f4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The execute statement code action now returns the rows a statement produces, and when it is disabled it says which setting enables it. Before, a
selectonly reported "Rows affected: N", and a disabled action only said "Statement execution is disabled in the settings." This PR also removes two panics on user configuration inDatabaseSettings: an invalid glob inallowStatementExecutionsAgainstand an invalidconnectionString.Result payload
workspace/executeCommandforpgls.executeStatementnow returns a structured result (it returnednullbefore) and still shows a short summary withshowMessage:The statement now runs over the simple query protocol (
sqlx::raw_sql) instead of as a prepared statement. That way Postgres sends every value in its text form, the same outputpsqlshows, so arrays, intervals, jsonb, and custom types need no decoding. At most 100 rows are returned, andtruncatedmarks larger results. Postgres sends no column metadata with an empty result. So when nothing was returned and nothing was affected, the statement is described afterwards to tell a 0-row query (columns set) apart from a command (rowsAffectedset). The payload is documented indocs/guides/configure_database.mdfor extension authors. The VS Code extension (supabase-community/postgres-language-server-vscode) needs a follow-up to render it.Disabled reason and invalid patterns
The reason now reads: "Statement execution is disabled for
127.0.0.1/postgres. Add a matching pattern todb.allowStatementExecutionsAgainst, e.g. ["127.0.0.1/*"]." An invalid glob inallowStatementExecutionsAgainstused to panic the server. Now it is ignored, a warning is logged, and the disabled reason lists it.Invalid connection string
An unparsable
db.connectionString(orDATABASE_URL) used to panic while loading the settings, which crashedcheckand the language server on startup or on a config reload. Now it disables the database connection, as if no host were configured, and logs a warning.checkreports it like a failed connection and exits non-zero:The language server shows the same message as a
showMessagewarning on every configuration load where the string is invalid. The message never repeats the connection string, since it may contain a password. WithdisableConnection: truethe string is not reported.Behavior change worth reviewing
execute_statementitself now checksallowStatementExecutionsAgainst. Before, only the code action was marked disabled, and a client callingpgls.executeStatementdirectly could execute against any database. A truncated result stops reading after 101 rows, but the server still sends the rest of the result, which sqlx drains before it reuses the connection.Addresses #771 and #511