MCPcopy Create free account
hub / github.com/TUM-Dev/NavigaTUM / store

Method store

server/src/setup/database/data.rs:101–129  ·  view source on GitHub ↗
(self, tx: &mut Transaction<'_, Postgres>)

Source from the content-addressed store, hash-verified

99 }
100 }
101 async fn store(self, tx: &mut Transaction<'_, Postgres>) -> Result<(), sqlx::Error> {
102 sqlx::query!(
103 r#"
104 INSERT INTO de(key,data,hash)
105 VALUES ($1,$2,$3)
106 ON CONFLICT (key) DO UPDATE
107 SET data = EXCLUDED.data,
108 hash = EXCLUDED.hash"#,
109 self.key,
110 self.de,
111 self.hash,
112 )
113 .execute(&mut **tx)
114 .await?;
115
116 sqlx::query!(
117 r#"
118 INSERT INTO en(key,data)
119 VALUES ($1,$2)
120 ON CONFLICT (key) DO UPDATE
121 SET data = EXCLUDED.data"#,
122 self.key,
123 self.en,
124 )
125 .execute(&mut **tx)
126 .await?;
127
128 Ok(())
129 }
130}
131#[tracing::instrument]
132pub async fn download_updates(

Callers 1

load_all_to_dbFunction · 0.45

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected