Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33295130
D5572.1768750718.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5572.1768750718.diff
View Options
diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs
--- a/services/identity/src/database.rs
+++ b/services/identity/src/database.rs
@@ -2,11 +2,12 @@
use std::fmt::{Display, Formatter, Result as FmtResult};
use std::sync::Arc;
+use aws_sdk_dynamodb::error::GetItemError;
use aws_sdk_dynamodb::model::AttributeValue;
use aws_sdk_dynamodb::output::{
GetItemOutput, PutItemOutput, QueryOutput, UpdateItemOutput,
};
-use aws_sdk_dynamodb::types::Blob;
+use aws_sdk_dynamodb::types::{Blob, SdkError};
use aws_sdk_dynamodb::{Client, Error as DynamoDBError};
use aws_types::sdk_config::SdkConfig;
use chrono::{DateTime, Utc};
@@ -316,6 +317,24 @@
}
}
}
+
+ async fn get_item_from_users_table(
+ &self,
+ user_id: &str,
+ ) -> Result<GetItemOutput, SdkError<GetItemError>> {
+ let primary_key = create_simple_primary_key((
+ USERS_TABLE_PARTITION_KEY.to_string(),
+ user_id.to_string(),
+ ));
+ self
+ .client
+ .get_item()
+ .table_name(USERS_TABLE)
+ .set_key(Some(primary_key))
+ .consistent_read(true)
+ .send()
+ .await
+ }
}
#[derive(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 18, 3:38 PM (9 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5952195
Default Alt Text
D5572.1768750718.diff (1 KB)
Attached To
Mode
D5572: [services][identity] helper function to get item from users table
Attached
Detach File
Event Timeline
Log In to Comment