DynamoDB class

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database, so that you don't have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling.

Constructors

DynamoDB({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

batchExecuteStatement({required List<BatchStatementRequest> statements}) Future<BatchExecuteStatementOutput>
This operation allows you to perform batch reads and writes on data stored in DynamoDB, using PartiQL.
batchGetItem({required Map<String, KeysAndAttributes> requestItems, ReturnConsumedCapacity? returnConsumedCapacity}) Future<BatchGetItemOutput>
The BatchGetItem operation returns the attributes of one or more items from one or more tables. You identify requested items by primary key.
batchWriteItem({required Map<String, List<WriteRequest>> requestItems, ReturnConsumedCapacity? returnConsumedCapacity, ReturnItemCollectionMetrics? returnItemCollectionMetrics}) Future<BatchWriteItemOutput>
The BatchWriteItem operation puts or deletes multiple items in one or more tables. A single call to BatchWriteItem can write up to 16 MB of data, which can comprise as many as 25 put or delete requests. Individual items to be written can be as large as 400 KB. The individual PutItem and DeleteItem operations specified in BatchWriteItem are atomic; however BatchWriteItem as a whole is not. If any requested operations fail because the table's provisioned throughput is exceeded or an internal processing failure occurs, the failed operations are returned in the UnprocessedItems response parameter. You can investigate and optionally resend the requests. Typically, you would call BatchWriteItem in a loop. Each iteration would check for unprocessed items and submit a new BatchWriteItem request with those unprocessed items until all items have been processed.
close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
createBackup({required String backupName, required String tableName}) Future<CreateBackupOutput>
Creates a backup for an existing table.
createGlobalTable({required String globalTableName, required List<Replica> replicationGroup}) Future<CreateGlobalTableOutput>
Creates a global table from an existing table. A global table creates a replication relationship between two or more DynamoDB tables with the same table name in the provided Regions. If you want to add a new replica table to a global table, each of the following conditions must be true:
createTable({required List<AttributeDefinition> attributeDefinitions, required List<KeySchemaElement> keySchema, required String tableName, BillingMode? billingMode, List<GlobalSecondaryIndex>? globalSecondaryIndexes, List<LocalSecondaryIndex>? localSecondaryIndexes, ProvisionedThroughput? provisionedThroughput, SSESpecification? sSESpecification, StreamSpecification? streamSpecification, List<Tag>? tags}) Future<CreateTableOutput>
The CreateTable operation adds a new table to your account. In an AWS account, table names must be unique within each Region. That is, you can have two tables with same name if you create the tables in different Regions.
deleteBackup({required String backupArn}) Future<DeleteBackupOutput>
Deletes an existing backup of a table.
deleteItem({required Map<String, AttributeValue> key, required String tableName, String? conditionExpression, ConditionalOperator? conditionalOperator, Map<String, ExpectedAttributeValue>? expected, Map<String, String>? expressionAttributeNames, Map<String, AttributeValue>? expressionAttributeValues, ReturnConsumedCapacity? returnConsumedCapacity, ReturnItemCollectionMetrics? returnItemCollectionMetrics, ReturnValue? returnValues}) Future<DeleteItemOutput>
Deletes a single item in a table by primary key. You can perform a conditional delete operation that deletes the item if it exists, or if it has an expected attribute value.
deleteTable({required String tableName}) Future<DeleteTableOutput>
The DeleteTable operation deletes a table and all of its items. After a DeleteTable request, the specified table is in the DELETING state until DynamoDB completes the deletion. If the table is in the ACTIVE state, you can delete it. If a table is in CREATING or UPDATING states, then DynamoDB returns a ResourceInUseException. If the specified table does not exist, DynamoDB returns a ResourceNotFoundException. If table is already in the DELETING state, no error is returned. When you delete a table, any indexes on that table are also deleted.
describeBackup({required String backupArn}) Future<DescribeBackupOutput>
Describes an existing backup of a table.
describeContinuousBackups({required String tableName}) Future<DescribeContinuousBackupsOutput>
Checks the status of continuous backups and point in time recovery on the specified table. Continuous backups are ENABLED on all tables at table creation. If point in time recovery is enabled, PointInTimeRecoveryStatus will be set to ENABLED.
describeContributorInsights({required String tableName, String? indexName}) Future<DescribeContributorInsightsOutput>
Returns information about contributor insights, for a given table or global secondary index.
describeEndpoints() Future<DescribeEndpointsResponse>
Returns the regional endpoint information.
describeExport({required String exportArn}) Future<DescribeExportOutput>
Describes an existing table export.
describeGlobalTable({required String globalTableName}) Future<DescribeGlobalTableOutput>
Returns information about the specified global table.
describeGlobalTableSettings({required String globalTableName}) Future<DescribeGlobalTableSettingsOutput>
Describes Region-specific settings for a global table.
describeKinesisStreamingDestination({required String tableName}) Future<DescribeKinesisStreamingDestinationOutput>
Returns information about the status of Kinesis streaming.
describeLimits() Future<DescribeLimitsOutput>
Returns the current provisioned-capacity quotas for your AWS account in a Region, both for the Region as a whole and for any one DynamoDB table that you create there.
describeTable({required String tableName}) Future<DescribeTableOutput>
Returns information about the table, including the current status of the table, when it was created, the primary key schema, and any indexes on the table.
describeTableReplicaAutoScaling({required String tableName}) Future<DescribeTableReplicaAutoScalingOutput>
Describes auto scaling settings across replicas of the global table at once.
describeTimeToLive({required String tableName}) Future<DescribeTimeToLiveOutput>
Gives a description of the Time to Live (TTL) status on the specified table.
disableKinesisStreamingDestination({required String streamArn, required String tableName}) Future<KinesisStreamingDestinationOutput>
Stops replication from the DynamoDB table to the Kinesis data stream. This is done without deleting either of the resources.
enableKinesisStreamingDestination({required String streamArn, required String tableName}) Future<KinesisStreamingDestinationOutput>
Starts table data replication to the specified Kinesis data stream at a timestamp chosen during the enable workflow. If this operation doesn't return results immediately, use DescribeKinesisStreamingDestination to check if streaming to the Kinesis data stream is ACTIVE.
executeStatement({required String statement, bool? consistentRead, String? nextToken, List<AttributeValue>? parameters}) Future<ExecuteStatementOutput>
This operation allows you to perform reads and singleton writes on data stored in DynamoDB, using PartiQL.
executeTransaction({required List<ParameterizedStatement> transactStatements, String? clientRequestToken}) Future<ExecuteTransactionOutput>
This operation allows you to perform transactional reads or writes on data stored in DynamoDB, using PartiQL.
exportTableToPointInTime({required String s3Bucket, required String tableArn, String? clientToken, ExportFormat? exportFormat, DateTime? exportTime, String? s3BucketOwner, String? s3Prefix, S3SseAlgorithm? s3SseAlgorithm, String? s3SseKmsKeyId}) Future<ExportTableToPointInTimeOutput>
Exports table data to an S3 bucket. The table must have point in time recovery enabled, and you can export data from any time within the point in time recovery window.
getItem({required Map<String, AttributeValue> key, required String tableName, List<String>? attributesToGet, bool? consistentRead, Map<String, String>? expressionAttributeNames, String? projectionExpression, ReturnConsumedCapacity? returnConsumedCapacity}) Future<GetItemOutput>
The GetItem operation returns a set of attributes for the item with the given primary key. If there is no matching item, GetItem does not return any data and there will be no Item element in the response.
listBackups({BackupTypeFilter? backupType, String? exclusiveStartBackupArn, int? limit, String? tableName, DateTime? timeRangeLowerBound, DateTime? timeRangeUpperBound}) Future<ListBackupsOutput>
List backups associated with an AWS account. To list backups for a given table, specify TableName. ListBackups returns a paginated list of results with at most 1 MB worth of items in a page. You can also specify a maximum number of entries to be returned in a page.
listContributorInsights({int? maxResults, String? nextToken, String? tableName}) Future<ListContributorInsightsOutput>
Returns a list of ContributorInsightsSummary for a table and all its global secondary indexes.
listExports({int? maxResults, String? nextToken, String? tableArn}) Future<ListExportsOutput>
Lists completed exports within the past 90 days.
listGlobalTables({String? exclusiveStartGlobalTableName, int? limit, String? regionName}) Future<ListGlobalTablesOutput>
Lists all global tables that have a replica in the specified Region.
listTables({String? exclusiveStartTableName, int? limit}) Future<ListTablesOutput>
Returns an array of table names associated with the current account and endpoint. The output from ListTables is paginated, with each page returning a maximum of 100 table names.
listTagsOfResource({required String resourceArn, String? nextToken}) Future<ListTagsOfResourceOutput>
List all tags on an Amazon DynamoDB resource. You can call ListTagsOfResource up to 10 times per second, per account.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putItem({required Map<String, AttributeValue> item, required String tableName, String? conditionExpression, ConditionalOperator? conditionalOperator, Map<String, ExpectedAttributeValue>? expected, Map<String, String>? expressionAttributeNames, Map<String, AttributeValue>? expressionAttributeValues, ReturnConsumedCapacity? returnConsumedCapacity, ReturnItemCollectionMetrics? returnItemCollectionMetrics, ReturnValue? returnValues}) Future<PutItemOutput>
Creates a new item, or replaces an old item with a new item. If an item that has the same primary key as the new item already exists in the specified table, the new item completely replaces the existing item. You can perform a conditional put operation (add a new item if one with the specified primary key doesn't exist), or replace an existing item if it has certain attribute values. You can return the item's attribute values in the same operation, using the ReturnValues parameter.
query({required String tableName, List<String>? attributesToGet, ConditionalOperator? conditionalOperator, bool? consistentRead, Map<String, AttributeValue>? exclusiveStartKey, Map<String, String>? expressionAttributeNames, Map<String, AttributeValue>? expressionAttributeValues, String? filterExpression, String? indexName, String? keyConditionExpression, Map<String, Condition>? keyConditions, int? limit, String? projectionExpression, Map<String, Condition>? queryFilter, ReturnConsumedCapacity? returnConsumedCapacity, bool? scanIndexForward, Select? select}) Future<QueryOutput>
The Query operation finds items based on primary key values. You can query any table or secondary index that has a composite primary key (a partition key and a sort key).
restoreTableFromBackup({required String backupArn, required String targetTableName, BillingMode? billingModeOverride, List<GlobalSecondaryIndex>? globalSecondaryIndexOverride, List<LocalSecondaryIndex>? localSecondaryIndexOverride, ProvisionedThroughput? provisionedThroughputOverride, SSESpecification? sSESpecificationOverride}) Future<RestoreTableFromBackupOutput>
Creates a new table from an existing backup. Any number of users can execute up to 4 concurrent restores (any type of restore) in a given account.
restoreTableToPointInTime({required String targetTableName, BillingMode? billingModeOverride, List<GlobalSecondaryIndex>? globalSecondaryIndexOverride, List<LocalSecondaryIndex>? localSecondaryIndexOverride, ProvisionedThroughput? provisionedThroughputOverride, DateTime? restoreDateTime, SSESpecification? sSESpecificationOverride, String? sourceTableArn, String? sourceTableName, bool? useLatestRestorableTime}) Future<RestoreTableToPointInTimeOutput>
Restores the specified table to the specified point in time within EarliestRestorableDateTime and LatestRestorableDateTime. You can restore your table to any point in time during the last 35 days. Any number of users can execute up to 4 concurrent restores (any type of restore) in a given account.
scan({required String tableName, List<String>? attributesToGet, ConditionalOperator? conditionalOperator, bool? consistentRead, Map<String, AttributeValue>? exclusiveStartKey, Map<String, String>? expressionAttributeNames, Map<String, AttributeValue>? expressionAttributeValues, String? filterExpression, String? indexName, int? limit, String? projectionExpression, ReturnConsumedCapacity? returnConsumedCapacity, Map<String, Condition>? scanFilter, int? segment, Select? select, int? totalSegments}) Future<ScanOutput>
The Scan operation returns one or more items and item attributes by accessing every item in a table or a secondary index. To have DynamoDB return fewer items, you can provide a FilterExpression operation.
tagResource({required String resourceArn, required List<Tag> tags}) Future<void>
Associate a set of tags with an Amazon DynamoDB resource. You can then activate these user-defined tags so that they appear on the Billing and Cost Management console for cost allocation tracking. You can call TagResource up to five times per second, per account.
toString() String
A string representation of this object.
inherited
transactGetItems({required List<TransactGetItem> transactItems, ReturnConsumedCapacity? returnConsumedCapacity}) Future<TransactGetItemsOutput>
TransactGetItems is a synchronous operation that atomically retrieves multiple items from one or more tables (but not from indexes) in a single account and Region. A TransactGetItems call can contain up to 25 TransactGetItem objects, each of which contains a Get structure that specifies an item to retrieve from a table in the account and Region. A call to TransactGetItems cannot retrieve items from tables in more than one AWS account or Region. The aggregate size of the items in the transaction cannot exceed 4 MB.
transactWriteItems({required List<TransactWriteItem> transactItems, String? clientRequestToken, ReturnConsumedCapacity? returnConsumedCapacity, ReturnItemCollectionMetrics? returnItemCollectionMetrics}) Future<TransactWriteItemsOutput>
TransactWriteItems is a synchronous write operation that groups up to 25 action requests. These actions can target items in different tables, but not in different AWS accounts or Regions, and no two actions can target the same item. For example, you cannot both ConditionCheck and Update the same item. The aggregate size of the items in the transaction cannot exceed 4 MB.
untagResource({required String resourceArn, required List<String> tagKeys}) Future<void>
Removes the association of tags from an Amazon DynamoDB resource. You can call UntagResource up to five times per second, per account.
updateContinuousBackups({required PointInTimeRecoverySpecification pointInTimeRecoverySpecification, required String tableName}) Future<UpdateContinuousBackupsOutput>
UpdateContinuousBackups enables or disables point in time recovery for the specified table. A successful UpdateContinuousBackups call returns the current ContinuousBackupsDescription. Continuous backups are ENABLED on all tables at table creation. If point in time recovery is enabled, PointInTimeRecoveryStatus will be set to ENABLED.
updateContributorInsights({required ContributorInsightsAction contributorInsightsAction, required String tableName, String? indexName}) Future<UpdateContributorInsightsOutput>
Updates the status for contributor insights for a specific table or index.
updateGlobalTable({required String globalTableName, required List<ReplicaUpdate> replicaUpdates}) Future<UpdateGlobalTableOutput>
Adds or removes replicas in the specified global table. The global table must already exist to be able to use this operation. Any replica to be added must be empty, have the same name as the global table, have the same key schema, have DynamoDB Streams enabled, and have the same provisioned and maximum write capacity units. If global secondary indexes are specified, then the following conditions must also be met:
updateGlobalTableSettings({required String globalTableName, BillingMode? globalTableBillingMode, List<GlobalTableGlobalSecondaryIndexSettingsUpdate>? globalTableGlobalSecondaryIndexSettingsUpdate, AutoScalingSettingsUpdate? globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, int? globalTableProvisionedWriteCapacityUnits, List<ReplicaSettingsUpdate>? replicaSettingsUpdate}) Future<UpdateGlobalTableSettingsOutput>
Updates settings for a global table.
updateItem({required Map<String, AttributeValue> key, required String tableName, Map<String, AttributeValueUpdate>? attributeUpdates, String? conditionExpression, ConditionalOperator? conditionalOperator, Map<String, ExpectedAttributeValue>? expected, Map<String, String>? expressionAttributeNames, Map<String, AttributeValue>? expressionAttributeValues, ReturnConsumedCapacity? returnConsumedCapacity, ReturnItemCollectionMetrics? returnItemCollectionMetrics, ReturnValue? returnValues, String? updateExpression}) Future<UpdateItemOutput>
Edits an existing item's attributes, or adds a new item to the table if it does not already exist. You can put, delete, or add attribute values. You can also perform a conditional update on an existing item (insert a new attribute name-value pair if it doesn't exist, or replace an existing name-value pair if it has certain expected attribute values).
updateTable({required String tableName, List<AttributeDefinition>? attributeDefinitions, BillingMode? billingMode, List<GlobalSecondaryIndexUpdate>? globalSecondaryIndexUpdates, ProvisionedThroughput? provisionedThroughput, List<ReplicationGroupUpdate>? replicaUpdates, SSESpecification? sSESpecification, StreamSpecification? streamSpecification}) Future<UpdateTableOutput>
Modifies the provisioned throughput settings, global secondary indexes, or DynamoDB Streams settings for a given table.
updateTableReplicaAutoScaling({required String tableName, List<GlobalSecondaryIndexAutoScalingUpdate>? globalSecondaryIndexUpdates, AutoScalingSettingsUpdate? provisionedWriteCapacityAutoScalingUpdate, List<ReplicaAutoScalingUpdate>? replicaUpdates}) Future<UpdateTableReplicaAutoScalingOutput>
Updates auto scaling settings on your global tables at once.
updateTimeToLive({required String tableName, required TimeToLiveSpecification timeToLiveSpecification}) Future<UpdateTimeToLiveOutput>
The UpdateTimeToLive method enables or disables Time to Live (TTL) for the specified table. A successful UpdateTimeToLive call returns the current TimeToLiveSpecification. It can take up to one hour for the change to fully process. Any additional UpdateTimeToLive calls for the same table during this one hour duration result in a ValidationException.

Operators

operator ==(Object other) bool
The equality operator.
inherited