Skip to content

Document the non-periodic password provider#346

Merged
roji merged 1 commit intonpgsql:mainfrom
roji:PasswordProvider
Jun 29, 2024
Merged

Document the non-periodic password provider#346
roji merged 1 commit intonpgsql:mainfrom
roji:PasswordProvider

Conversation

@roji
Copy link
Copy Markdown
Member

@roji roji commented Jun 29, 2024

@roji roji enabled auto-merge (squash) June 29, 2024 09:00
@roji roji merged commit a985fc3 into npgsql:main Jun 29, 2024
@roji roji deleted the PasswordProvider branch June 29, 2024 09:01
github-actions Bot pushed a commit that referenced this pull request Jun 29, 2024
await using var dataSource = dataSourceBuilder.Build();
```

Every time a new physical connection needs to be opened to PostgreSQL, either the synchronous `passwordProvider` or the asynchronous `passwordProviderAsync` will be called (depending whether you used `Open()` or `OpenAsync()`). Since modern .NET applications are encouraged to always use synchronous I/O, it's good practice to simply throw in the synchronous password provider, as above.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤦

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.

1 participant