Browse Source

postgres add_weapon_modifier

pbs
jake 4 years ago
parent
commit
5bdac4f6de
  1. 9
      src/entity/gateway/postgres/postgres.rs

9
src/entity/gateway/postgres/postgres.rs

@ -407,6 +407,15 @@ impl EntityGateway for PostgresGateway {
.execute(&self.pool).await?; .execute(&self.pool).await?;
Ok(()) 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<Vec<ItemEntity>, GatewayError> { async fn get_items_by_character(&self, char_id: &CharacterEntityId) -> Result<Vec<ItemEntity>, GatewayError> {
let q = r#"select * from ( let q = r#"select * from (

Loading…
Cancel
Save