docs: Explain sqlx usage Both how migrations are ran, as well as how to create migrations is now described in the readme. This should help contributors going when introducing a new model.

zj
Aug 10, 2021, 7:54 PM
5NM5MBQ4TC22T7BRNFOJNDFRPDGLBFC6IHZ7SLO3AJZINKPLQXNAC

Dependencies

  • [2] BAWJ3BJ5 nix: Do not start PG if running In a nix hook the PG server is started when `nix-shell` is invoked. This created extra output when nix-shell was invoked on an extra shell as it tried to start a new PG server again while it was already running. This change updates the behaviour to not do this, and verify with pg_ctl if PG is already running.
  • [*] K4JNAJOF database: Connect to postgres on Rocket boot As database I've chosen PostgreSQL, as my personal experience has been good with it. This change allows Rocket to connect to the database on booting the server. It depends on the DATABASE_URL being set, and for now circumvents the Rocket config helpers as it seemed faster to be up and running this way.

Change contents

  • edit in README.md at line 19
    [2.352]
    [2.352]
    ##### Database migrations
    This project uses `sqlx` to integrate with the database. Migrations are run when
    Rocket lifts off (boots its runtime).
    Generating a new migrations is done by running: `sqlx migrate add -r <description>`.
    Note both an up and down migration are required.