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

feat: get configuration parameters from the db and allow reloading config with NOTIFY #1729

Merged
merged 4 commits into from
Jan 19, 2021

Commits on Jan 16, 2021

  1. Configuration menu
    Copy the full SHA
    42e665d View commit details
    Browse the repository at this point in the history
  2. Correct --dump-schema swallowing error

    When there's no connection to pg, the following error happens
    when running --dump-schema:
    
    postgrest: user error (Pattern match failure in do expression at
    main/Main.hs:361:5-14)
    
    Now it shows a regular "could not connect to server.." error.
    steve-chavez committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    8289cf5 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2021

  1. feat: get configuration parameters from the db

    Allows configuring postgrest from the db by setting config parameters
    on the connection role. For example:
    
    ALTER ROLE postgrest_test_authenticator
    SET pgrst.jwt-secret = "REALLYREALLYREALLYREALLYVERYSAFE"
    
    The above wWill set the `jwt-secret` config option accordingly.
    
    SUPERUSER privileges are required for ALTERing role settings,
    so this might not work on some cloud-managed databases.
    
    This feature is enabled by default, for disabling it you can add the
    following to the config file:
    
    db-load-guc-config = false
    steve-chavez committed Jan 19, 2021
    Configuration menu
    Copy the full SHA
    b489adc View commit details
    Browse the repository at this point in the history
  2. feat: allow reloading config with NOTIFY

    Enables reloading the config by doing:
    NOTIFY pgrst, 'reload config'
    
    Adds an alias for reloading the schema cache:
    NOTIFY pgrst, 'reload schema'
    steve-chavez committed Jan 19, 2021
    Configuration menu
    Copy the full SHA
    0fecc50 View commit details
    Browse the repository at this point in the history