Skip to content

Conversation

@juleswritescode
Copy link
Collaborator

@juleswritescode juleswritescode commented Apr 25, 2025

If the user did not specify the db section in the jsonc, we would per default try to connect to postgresql://postgres:[email protected]:5432/postgres.

The reason is the biome_serialize_macros::Merge macro:

If two configuration.dbs are None, they are merged into a Some(PartialConfiguration {}) where all properties are None; if we then call DatabaseSettings::from(partial_configuration), the partial config is merged with DatabaseSettings::default() – where we specified the above connection settings.

We can't really work around that without refactoring the whole configuration shenaigans, so I pulled the cli_options.skip_db flag into the database settings.

You can still pass it as postgrestools check --disable-db test.sql, and it is hidden in the .jsonc.

When a user does not specify a db.host in the jsonc, all db-connections are now disabled.

/**
* The Cursor position in the file for which a completion is requested.
*/
position: TextSize;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto-generated

@juleswritescode juleswritescode merged commit 2820bb5 into main Apr 25, 2025
7 checks passed
@juleswritescode juleswritescode deleted the fix/default-db-connection branch October 28, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants