Skip to content

Commit

Permalink
formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Nov 12, 2023
1 parent eb63444 commit d47bf63
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/calendar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please follow the [system dependencys docs](resources/documentation/Dependencys.
To set up the database, you will need to run a `postgres` instance. We recommend this configuration:

```bash
docker run -p 5432:5432 -e POSTGRES_PASSWORD=password postgres
docker run -it --rm -e POSTGRES_PASSWORD=password -p 5432:5432 postgres:latest
```

Any migrations this database needs are applied on first run of the server.
Expand Down
2 changes: 1 addition & 1 deletion server/calendar/diesel.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# see https://diesel.rs/guides/configuring-diesel-cli

[print_schema]
file = "src/schema.rs"
file = "src/schema.rs"
2 changes: 1 addition & 1 deletion server/main-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ MeiliSearch provides an interactive interface at <http://localhost:7700>.
To set up the Postgres, run the following command:

```bash
docker run --name postgres -e POSTGRES_PASSWORD=password -p 5432:5432 postgres
docker run -it --rm -e POSTGRES_PASSWORD=password -p 5432:5432 postgres:latest
```

### Starting the server
Expand Down
4 changes: 2 additions & 2 deletions server/main-api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use actix_cors::Cors;
use actix_web::{get, middleware, web, App, HttpResponse, HttpServer};
use actix_web_prom::PrometheusMetricsBuilder;
use log::{debug, error, info};
use sqlx::prelude::*;
use sqlx::postgres::PgPoolOptions;
use sqlx::prelude::*;
use sqlx::PgPool;
use std::collections::HashMap;
use structured_logger::async_json::new_writer;
Expand Down Expand Up @@ -55,7 +55,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Builder::with_level("info")
.with_target_writer("*", new_writer(tokio::io::stdout()))
.init();
let uri=connection_string();
let uri = connection_string();
let pool = PgPoolOptions::new().connect(&uri).await?;
info!("setting up the database");
setup::database::setup_database(&pool).await?;
Expand Down
5 changes: 4 additions & 1 deletion server/main-api/src/setup/database/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ impl From<HashMap<String, Value>> for DelocalisedValues {
}

impl DelocalisedValues {
async fn store(self, tx: &mut sqlx::Transaction<'_, sqlx::Postgres>) -> Result<(), sqlx::Error> {
async fn store(
self,
tx: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> Result<(), sqlx::Error> {
let key = self.key.clone(); // has to be here due to livetimes somehow
let (data, fields) = StorableValue::from(self.de);
sqlx::query!(
Expand Down

0 comments on commit d47bf63

Please sign in to comment.