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, ReturnConsumedCapacity? returnConsumedCapacity}) → Future<BatchExecuteStatementOutput> -
This operation allows you to perform batch reads or writes on data stored
in DynamoDB, using PartiQL. Each read statement in a
BatchExecuteStatementmust specify an equality condition on all key attributes. This enforces that eachSELECTstatement in a batch returns at most a single item. For more information, see Running batch operations with PartiQL for DynamoDB . -
batchGetItem(
{required Map< String, KeysAndAttributes> requestItems, ReturnConsumedCapacity? returnConsumedCapacity}) → Future<BatchGetItemOutput> -
The
BatchGetItemoperation 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< requestItems, ReturnConsumedCapacity? returnConsumedCapacity, ReturnItemCollectionMetrics? returnItemCollectionMetrics}) → Future<WriteRequest> >BatchWriteItemOutput> -
The
BatchWriteItemoperation puts or deletes multiple items in one or more tables. A single call toBatchWriteItemcan transmit up to 16MB of data over the network, consisting of up to 25 item put or delete operations. While individual items can be up to 400 KB once stored, it's important to note that an item's representation might be greater than 400KB while being sent in DynamoDB's JSON format for the API call. For more details on this distinction, see Naming Rules and Data Types. The individualPutItemandDeleteItemoperations specified inBatchWriteItemare atomic; howeverBatchWriteItemas 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 theUnprocessedItemsresponse parameter. You can investigate and optionally resend the requests. Typically, you would callBatchWriteItemin a loop. Each iteration would check for unprocessed items and submit a newBatchWriteItemrequest 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.
-
createTable(
{required String tableName, List< AttributeDefinition> ? attributeDefinitions, BillingMode? billingMode, bool? deletionProtectionEnabled, List<GlobalSecondaryIndex> ? globalSecondaryIndexes, GlobalTableSettingsReplicationMode? globalTableSettingsReplicationMode, String? globalTableSourceArn, List<KeySchemaElement> ? keySchema, List<LocalSecondaryIndex> ? localSecondaryIndexes, OnDemandThroughput? onDemandThroughput, ProvisionedThroughput? provisionedThroughput, String? resourcePolicy, SSESpecification? sSESpecification, StreamSpecification? streamSpecification, TableClass? tableClass, List<Tag> ? tags, WarmThroughput? warmThroughput}) → Future<CreateTableOutput> -
The
CreateTableoperation adds a new table to your account. In an Amazon Web Services 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, ReturnValuesOnConditionCheckFailure? returnValuesOnConditionCheckFailure}) → 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.
-
deleteResourcePolicy(
{required String resourceArn, String? expectedRevisionId}) → Future< DeleteResourcePolicyOutput> - Deletes the resource-based policy attached to the resource, which can be a table or stream.
-
deleteTable(
{required String tableName}) → Future< DeleteTableOutput> -
The
DeleteTableoperation deletes a table and all of its items. After aDeleteTablerequest, the specified table is in theDELETINGstate until DynamoDB completes the deletion. If the table is in theACTIVEstate, you can delete it. If a table is inCREATINGorUPDATINGstates, then DynamoDB returns aResourceInUseException. If the specified table does not exist, DynamoDB returns aResourceNotFoundException. If table is already in theDELETINGstate, 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
ENABLEDon all tables at table creation. If point in time recovery is enabled,PointInTimeRecoveryStatuswill 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. For more information on policy permissions, please see Internetwork traffic privacy.
-
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.
-
describeImport(
{required String importArn}) → Future< DescribeImportOutput> - Represents the properties of the import.
-
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 Amazon Web Services 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, EnableKinesisStreamingConfiguration? enableKinesisStreamingConfiguration}) → 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, EnableKinesisStreamingConfiguration? enableKinesisStreamingConfiguration}) → 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, int? limit, String? nextToken, List< AttributeValue> ? parameters, ReturnConsumedCapacity? returnConsumedCapacity, ReturnValuesOnConditionCheckFailure? returnValuesOnConditionCheckFailure}) → 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, ReturnConsumedCapacity? returnConsumedCapacity}) → 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, ExportType? exportType, IncrementalExportSpecification? incrementalExportSpecification, 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
GetItemoperation returns a set of attributes for the item with the given primary key. If there is no matching item,GetItemdoes not return any data and there will be noItemelement in the response. -
getResourcePolicy(
{required String resourceArn}) → Future< GetResourcePolicyOutput> - Returns the resource-based policy document attached to the resource, which can be a table or stream, in JSON format.
-
importTable(
{required InputFormat inputFormat, required S3BucketSource s3BucketSource, required TableCreationParameters tableCreationParameters, String? clientToken, InputCompressionType? inputCompressionType, InputFormatOptions? inputFormatOptions}) → Future< ImportTableOutput> - Imports table data from an S3 bucket.
-
listBackups(
{BackupTypeFilter? backupType, String? exclusiveStartBackupArn, int? limit, String? tableName, DateTime? timeRangeLowerBound, DateTime? timeRangeUpperBound}) → Future< ListBackupsOutput> -
List DynamoDB backups that are associated with an Amazon Web Services
account and weren't made with Amazon Web Services Backup. To list these
backups for a given table, specify
TableName.ListBackupsreturns 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, in reverse alphanumeric
order of
ExportArn. -
listGlobalTables(
{String? exclusiveStartGlobalTableName, int? limit, String? regionName}) → Future< ListGlobalTablesOutput> - Lists all global tables that have a replica in the specified Region.
-
listImports(
{String? nextToken, int? pageSize, String? tableArn}) → Future< ListImportsOutput> - Lists completed imports within the past 90 days.
-
listTables(
{String? exclusiveStartTableName, int? limit}) → Future< ListTablesOutput> -
Returns an array of table names associated with the current account and
endpoint. The output from
ListTablesis 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, ReturnValuesOnConditionCheckFailure? returnValuesOnConditionCheckFailure}) → 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
ReturnValuesparameter. -
putResourcePolicy(
{required String policy, required String resourceArn, bool? confirmRemoveSelfResourceAccess, String? expectedRevisionId}) → Future< PutResourcePolicyOutput> - Attaches a resource-based policy document to the resource, which can be a table or stream. When you attach a resource-based policy using this API, the policy application is eventually consistent .
-
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> -
You must provide the name of the partition key attribute and a single
value for that attribute.
Queryreturns all items with that partition key value. Optionally, you can provide a sort key attribute and use a comparison operator to refine the search results. -
restoreTableFromBackup(
{required String backupArn, required String targetTableName, BillingMode? billingModeOverride, List< GlobalSecondaryIndex> ? globalSecondaryIndexOverride, List<LocalSecondaryIndex> ? localSecondaryIndexOverride, OnDemandThroughput? onDemandThroughputOverride, ProvisionedThroughput? provisionedThroughputOverride, SSESpecification? sSESpecificationOverride}) → Future<RestoreTableFromBackupOutput> - Creates a new table from an existing backup. Any number of users can execute up to 50 concurrent restores (any type of restore) in a given account.
-
restoreTableToPointInTime(
{required String targetTableName, BillingMode? billingModeOverride, List< GlobalSecondaryIndex> ? globalSecondaryIndexOverride, List<LocalSecondaryIndex> ? localSecondaryIndexOverride, OnDemandThroughput? onDemandThroughputOverride, 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
EarliestRestorableDateTimeandLatestRestorableDateTime. You can restore your table to any point in time in the last 35 days. You can set the recovery period to any value between 1 and 35 days. Any number of users can execute up to 50 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
Scanoperation 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 aFilterExpressionoperation. -
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> -
TransactGetItemsis a synchronous operation that atomically retrieves multiple items from one or more tables (but not from indexes) in a single account and Region. ATransactGetItemscall can contain up to 100TransactGetItemobjects, each of which contains aGetstructure that specifies an item to retrieve from a table in the account and Region. A call toTransactGetItemscannot retrieve items from tables in more than one Amazon Web Services 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> -
TransactWriteItemsis a synchronous write operation that groups up to 100 action requests. These actions can target items in different tables, but not in different Amazon Web Services accounts or Regions, and no two actions can target the same item. For example, you cannot bothConditionCheckandUpdatethe 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
UntagResourceup to five times per second, per account. -
updateContinuousBackups(
{required PointInTimeRecoverySpecification pointInTimeRecoverySpecification, required String tableName}) → Future< UpdateContinuousBackupsOutput> -
UpdateContinuousBackupsenables or disables point in time recovery for the specified table. A successfulUpdateContinuousBackupscall returns the currentContinuousBackupsDescription. Continuous backups areENABLEDon all tables at table creation. If point in time recovery is enabled,PointInTimeRecoveryStatuswill be set to ENABLED. -
updateContributorInsights(
{required ContributorInsightsAction contributorInsightsAction, required String tableName, ContributorInsightsMode? contributorInsightsMode, String? indexName}) → Future< UpdateContributorInsightsOutput> - Updates the status for contributor insights for a specific table or index. CloudWatch Contributor Insights for DynamoDB graphs display the partition key and (if applicable) sort key of frequently accessed items and frequently throttled items in plaintext. If you require the use of Amazon Web Services Key Management Service (KMS) to encrypt this table’s partition key and sort key data with an Amazon Web Services managed key or customer managed key, you should not enable CloudWatch Contributor Insights for DynamoDB for this table.
-
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.
-
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, ReturnValuesOnConditionCheckFailure? returnValuesOnConditionCheckFailure, 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).
-
updateKinesisStreamingDestination(
{required String streamArn, required String tableName, UpdateKinesisStreamingConfiguration? updateKinesisStreamingConfiguration}) → Future< UpdateKinesisStreamingDestinationOutput> - The command to update the Kinesis stream destination.
-
updateTable(
{required String tableName, List< AttributeDefinition> ? attributeDefinitions, BillingMode? billingMode, bool? deletionProtectionEnabled, List<GlobalSecondaryIndexUpdate> ? globalSecondaryIndexUpdates, GlobalTableSettingsReplicationMode? globalTableSettingsReplicationMode, List<GlobalTableWitnessGroupUpdate> ? globalTableWitnessUpdates, MultiRegionConsistency? multiRegionConsistency, OnDemandThroughput? onDemandThroughput, ProvisionedThroughput? provisionedThroughput, List<ReplicationGroupUpdate> ? replicaUpdates, SSESpecification? sSESpecification, StreamSpecification? streamSpecification, TableClass? tableClass, WarmThroughput? warmThroughput}) → 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
UpdateTimeToLivemethod enables or disables Time to Live (TTL) for the specified table. A successfulUpdateTimeToLivecall returns the currentTimeToLiveSpecification. It can take up to one hour for the change to fully process. Any additionalUpdateTimeToLivecalls for the same table during this one hour duration result in aValidationException.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited