Skip to content
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
merged 6 commits into from
Apr 20, 2021
Merged

More database nits #1773

merged 6 commits into from
Apr 20, 2021

Commits on Apr 19, 2021

  1. Configuration menu
    Copy the full SHA
    e1fcdf4 View commit details
    Browse the repository at this point in the history
  2. optional read-only user

    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.
    pm47 committed Apr 19, 2021
    Configuration menu
    Copy the full SHA
    6d901a3 View commit details
    Browse the repository at this point in the history
  3. set timezone on lease table

    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.
    pm47 committed Apr 19, 2021
    Configuration menu
    Copy the full SHA
    641555f View commit details
    Browse the repository at this point in the history
  4. put back lock timeout on lease table

    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.
    pm47 committed Apr 19, 2021
    Configuration menu
    Copy the full SHA
    e8872f0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    38dba58 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2021

  1. set lock timeout at connection creation

    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
    pm47 committed Apr 20, 2021
    Configuration menu
    Copy the full SHA
    7a5bf88 View commit details
    Browse the repository at this point in the history