From 5bdac4f6de72788160c909099533b1f0960692ae Mon Sep 17 00:00:00 2001 From: jake Date: Thu, 3 Dec 2020 14:58:17 -0700 Subject: [PATCH] postgres add_weapon_modifier --- src/entity/gateway/postgres/postgres.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/entity/gateway/postgres/postgres.rs b/src/entity/gateway/postgres/postgres.rs index 1239f1d..45aee91 100644 --- a/src/entity/gateway/postgres/postgres.rs +++ b/src/entity/gateway/postgres/postgres.rs @@ -407,6 +407,15 @@ impl EntityGateway for PostgresGateway { .execute(&self.pool).await?; Ok(()) } + + async fn add_weapon_modifier(&mut self, item_id: &ItemEntityId, modifier: weapon::WeaponModifier) -> Result<(), GatewayError> { + sqlx::query("insert into weapon_modifier (weapon, modifier) values ($1, $2);") + .bind(item_id.0) + .bind(sqlx::types::Json(modifier)) + .execute(&self.pool).await?; + Ok(()) + } + /* async fn get_items_by_character(&self, char_id: &CharacterEntityId) -> Result, GatewayError> { let q = r#"select * from (