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.
Dependencies
- [2]
EIIUUAKGnix: Install and initialize a Postgres DB For a persistance layer, this change introduces postgresql as dependency. The daemon is started when `nix-shell` is invoked. `pg_ctl stop` is not invoked, and this has to be done by a developer. Data is persisted in a tmp directory, which is added to the ignore file. - [3]
K4JNAJOFdatabase: 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. - [4]
W3M3C7CCInitial commit This change includes a very small hello world application server written in Rust using Rocket.rs. Managing dependencies is done with Nix as that works well between Linux and Mac for me.
Change contents
- replacement in shell.nix at line 36
pg_ctl start -l $LOG_PATH -o "-c listen_addresses= -c unix_socket_directories=$PGHOST"if ! pg_ctl status &>2; thenpg_ctl start -l $LOG_PATH -o "-c listen_addresses= -c unix_socket_directories=$PGHOST"fi - edit in README.md at line 13
When `nix-shell` is in your `$PATH`, execute: `nix-shell`. Nix will download andmanage dependencies for you. Nix will also start a postgresql server and initiatethe database. - edit in README.md at line 18
To start the server run: `cargo run`.