Repository navigation
Conversation
The database environment variables only fill in the connection options a nested configuration file doesn't set itself. A workspace folder whose configuration fails to load keeps its own project instead of borrowing another folder's, files outside every folder use a folder-less project with the defaults, and the CLI reports a broken nested configuration with its path and keeps checking with the defaults for that folder.
This was referenced Oct 24, 2026
…lation # Conflicts: # crates/pgls_lsp/src/session.rs
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.
Stacked on #895 (which is stacked on #881). Must merge after #881.
Three ways a file could end up with another folder's settings, and with them another folder's database.
Environment variables collapsed nested databases (C4).
DATABASE_URLandPG*were laid over every nested configuration. WithPGDATABASE=postgres(or aDATABASE_URLfrom Rails/Prisma/sqlx) in the shell,db1/anddb2/both connected to that database, which defeats the main use case of #881:Precedence now (documented in
docs/configuration.md):host,port,username,password,database) the file doesn't set itself. Options it only gets throughextendsare overridden like in the root, soextends: ["../../root"]+"database": "db1"connects to$PGHOST/db1in CI.DATABASE_URLis only used when the file sets no connection option, because a connection string wins over the other options.--connection-string, …) and the editor's client overrides still apply to every file: they are explicit for this run.I picked this over "environment for the root only" because a nested file without a
dbsection (only linter settings, say) should still connect like the root in CI.A broken workspace-folder config used another folder's settings (C6). In the LSP, a workspace folder whose configuration failed to load at startup was unregistered, and
project_keyfell back to the shallowest other folder. Now the folder keeps its project (its previous settings, or the defaults if it's new) and the error is logged. Files outside every workspace folder get a folder-less project with the defaults instead of some folder's. Without workspace folders or root, or with an explicitconfigurationPath, the only project still applies to every file.A broken nested config aborted the CLI (C9).
checkfailed withconfiguration × key must be a string at line 1 column 3without naming the file, and checked nothing. Now each broken nested file is reported with its path, its folder uses the defaults (like the LSP), and the run continues; the run still fails because of the reported error:With
--stdin-file-path, the errors go to stderr.Tests
pgls_configuration:the_environment_only_fills_in_what_a_nested_configuration_does_not_set.the_environment_does_not_replace_the_database_of_a_nested_configuration(no env,PGDATABASE,DATABASE_URL; Linux, uses the test DB server),check_reports_a_broken_nested_configuration_and_continues.files_never_get_the_settings_of_another_workspace_folder: a folder with a broken config and a file outside every folder get the defaults, not the other folder'sbanDropColumn: error.Not covered