stregsystem-rs is the rust edition of the stregsystem, with additional improvements.Some parts are still WIP.
Build the project with
Make sure that rust is installed on your system.You will need to installsqlx-cli
.
After this step create a file in the root of the project named.env
.This file should contain the following:
DATABASE_URL=postgres://stregsystemet:password@localhost/stregsystemet
The before you can build the project you need to run a postgres instance.Included in the project are scripts that starts an emphemeral postgres instance using docker (or podman).To start postgres run the following script:
./scripts/start_postgres.sh
On Windows this is
scripts\start_postgres.bat
Afterwards the database schema must be initialized by running:
On Windows:
Optionally you can insert test data into the database:
./scripts/populate_sample_data.sh
On Windows:
scripts\populate_sample_data.bat
You can now build and run the project with:
Before you commit your changes you must format the code and satisfy the linter:
Lastly, you have to update the sqlx files if you have updated any files with sql: