Skip to content

Make whoami optional, and only pull it in for postgres - #1571

Merged
abonander merged 1 commit into
transact-rs:masterfrom
joshtriplett:postgres-whoami
Dec 21, 2021
Merged

abonander merged 1 commit into
transact-rs:masterfrom
joshtriplett:postgres-whoami

Conversation

@joshtriplett

Copy link
Copy Markdown
Contributor

sqlx-core uses whoami to provide the fallback for postgres username. If
not building postgres support, omit the dependency on whoami.

sqlx-core uses whoami to provide the fallback for postgres username. If
not building postgres support, omit the dependency on whoami.
@abonander
abonander merged commit 2e6ab7c into transact-rs:master Dec 21, 2021
@joshtriplett
joshtriplett deleted the postgres-whoami branch December 21, 2021 13:07
ricochet added a commit to ricochet/sqlx that referenced this pull request Feb 18, 2026
Make the `whoami` dependency a feature gate (`whoami`) on `sqlx-postgres` so it can be disabled by users who don't need OS username fallback.

When disabled, the default username falls back to "unknown" if `PGUSER` is not set.

The feature is included in the top-level `sqlx` crate's default features, so existing behavior is preserved.

Follows up on transact-rs#1571 and transact-rs#2319.
ricochet added a commit to ricochet/sqlx that referenced this pull request Feb 18, 2026
Make the `whoami` dependency a feature gate (`whoami`) on `sqlx-postgres` so it can be disabled by users who don't need OS username fallback.

When disabled, the default username falls back to "unknown" if `PGUSER` is not set.

The feature is included in the top-level `sqlx` crate's default features, so existing behavior is preserved.

Follows up on transact-rs#1571 and transact-rs#2319.
ricochet added a commit to ricochet/sqlx that referenced this pull request Feb 18, 2026
Make the `whoami` dependency a feature gate (`whoami`) on `sqlx-postgres` so it can be disabled by users who don't need OS username fallback.

When disabled, the default username falls back to "unknown" if `PGUSER` is not set.

The feature is included in the top-level `sqlx` crate's default features, so existing behavior is preserved.

Follows up on transact-rs#1571 and transact-rs#2319.
ricochet added a commit to ricochet/sqlx that referenced this pull request Feb 26, 2026
Make the `whoami` dependency a feature gate (`whoami`) on `sqlx-postgres` so it can be disabled by users who don't need OS username fallback.

When disabled, the default username falls back to "unknown" if `PGUSER` is not set.

The feature is included in the top-level `sqlx` crate's default features, so existing behavior is preserved.

Follows up on transact-rs#1571 and transact-rs#2319.
ricochet added a commit to ricochet/sqlx that referenced this pull request Jun 2, 2026
Make the `whoami` dependency a feature gate (`whoami`) on `sqlx-postgres` so it can be disabled by users who don't need OS username fallback.

When disabled, the default username falls back to "unknown" if `PGUSER` is not set.

The feature is included in the top-level `sqlx` crate's default features, so existing behavior is preserved.

Follows up on transact-rs#1571 and transact-rs#2319.
rukai pushed a commit to rukai/sqlx that referenced this pull request Nov 2, 2026
Make the `whoami` dependency a feature gate (`whoami`) on `sqlx-postgres` so it can be disabled by users who don't need OS username fallback.

When disabled, the default username falls back to "unknown" if `PGUSER` is not set.

The feature is included in the top-level `sqlx` crate's default features, so existing behavior is preserved.

Follows up on transact-rs#1571 and transact-rs#2319.
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.

2 participants