pub struct DynamoDb { /* private fields */ }Expand description
A DynamoDB Driver backed by the AWS SDK.
Create one with DynamoDb::from_env to load AWS credentials and region
from the environment, or DynamoDb::new / DynamoDb::with_sdk_config
for manual setup.
Implementations§
Source§impl DynamoDb
impl DynamoDb
Sourcepub fn new(url: String, client: Client) -> Self
pub fn new(url: String, client: Client) -> Self
Create driver with pre-built client (backward compatible, synchronous)
Sourcepub async fn from_env(url: String) -> Result<Self>
pub async fn from_env(url: String) -> Result<Self>
Create driver loading AWS config from environment (async factory) Reads: AWS_REGION, AWS_ENDPOINT_URL_DYNAMODB, AWS credentials, etc.
Sourcepub fn with_sdk_config(url: String, sdk_config: &SdkConfig) -> Self
pub fn with_sdk_config(url: String, sdk_config: &SdkConfig) -> Self
Create driver with custom SdkConfig (synchronous)
Trait Implementations§
Source§impl Driver for DynamoDb
impl Driver for DynamoDb
Source§fn capability(&self) -> &'static Capability
fn capability(&self) -> &'static Capability
Describes the driver’s capability, which informs the query planner.
Source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
cx: &'life1 ConnectContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
cx: &'life1 ConnectContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new connection to the database. Read more
Source§fn generate_migration(&self, _schema_diff: &Schema<'_>) -> Migration
fn generate_migration(&self, _schema_diff: &Schema<'_>) -> Migration
Generates a migration from a
diff::Schema.Source§fn reset_db<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset_db<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drops the entire database and recreates an empty one without applying migrations. Read more
Source§fn max_connections(&self) -> Option<usize>
fn max_connections(&self) -> Option<usize>
Returns the maximum number of simultaneous database connections supported. For example,
this is
Some(1) for the in-memory SQLite driver which cannot be pooled.Auto Trait Implementations§
impl !RefUnwindSafe for DynamoDb
impl !UnwindSafe for DynamoDb
impl Freeze for DynamoDb
impl Send for DynamoDb
impl Sync for DynamoDb
impl Unpin for DynamoDb
impl UnsafeUnpin for DynamoDb
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.