-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More database nits #1773
Merged
More database nits #1773
Conversation
This file contains 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
It is good practice to create a dedicated read-only user to browse the database safely. But since the app itself creates its tables, the postgres user is the owner and a manual `GRANT` is required everytime a new table is added. This PR makes it possible to specify an arbitrary username, that will be granted read-only access to all tables in the `public` schema. NB: The assumption here is that eclair is the only app using the eclair database (in the `CREATE DATABASE eclair` sense), which I believe is reasonable.
This only affects newly created table, there is no migration. Users that are already using postgres will keep the previous column type, it doesn't change anything for them.
We use a timeout, because due to concurrency we may not be able to obtain a lock immediately. The timeout has been set to its original value of 5s and made configurable.
Rebased. |
t-bast
reviewed
Apr 20, 2021
From Hikari doc: > 🔤connectionInitSql This property sets a SQL statement that will be executed after every new connection creation before adding it to the pool. If this SQL is not valid or throws an exception, it will be treated as a connection failure and the standard retry logic will be followed. Default: none
Codecov Report
@@ Coverage Diff @@
## master #1773 +/- ##
==========================================
- Coverage 89.31% 89.31% -0.01%
==========================================
Files 144 144
Lines 10880 10892 +12
Branches 465 459 -6
==========================================
+ Hits 9718 9728 +10
- Misses 1162 1164 +2
|
t-bast
approved these changes
Apr 20, 2021
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.
Commits are independent and are best reviewed separately.