Page tree

Objects

IconDescription

Python DynamoDB Database

Python DynamoDB Table

Python Unknown DynamoDB Table

Boto3 framework

The support for DynamoDB in boto3 is focused on creating DynamoDB tables and adding links representing CRUD-like operations on them.

Methods for creation of tables.

Supported API methods

Link TypeCallerCalleeRemark

botocore.client.DynamoDB.create_table()

N/AN/A

N/A


Side effect: creation of DynamoDB tables and parent database

boto3.resources.factory.dynamodb.ServiceResource.create_table()

Method for getting a paginator from a dynamodb client object.

Supported API methods

Link TypeCallerCalleeRemark

botocore.client.DynamoDB.get_paginator()

N/AN/A

N/A

Returns a Paginator object (see below for supported Paginator methods)

The boto3 high-level DynamoDB resource methods.

Supported API methods 
(boto3.resources.factory.dynamodb

Link TypeCallerCallee
batch_get_item()useSelectLinkPython callable artifactPython (Unknown) DynamoDB Table
batch_write_item()useInsertLink, useDeleteLink

The boto3 high-level table resource methods for the DynamoDB database API.

Supported API methods 
(boto3.resources.factory.dynamodb.Table

Link TypeCallerCalleeRemark
batch_writer()N/AN/AN/AReturns a BatchWriter object (see below table for supported BatchWriter methods)
delete()useDeleteLinkPython callable artifact







Python (Unknown) DynamoDB Table








delete_item()useDeleteLink
get_item()useSelectLink
load()useUpdateLink
put_item()useInsertLink, useDeleteLink, useSelectLink
query()useSelectLink
reload()useUpdateLink
scan()useSelectLink
update_item()useUpdateLink, useInsertLink, useSelectLink

Batch-writer methods.

Supported API methods (boto3.resources.factory.dynamodb.table.BatchWriter)

Link TypeCallerCallee
put_item()useInsertLink, useDeleteLink, useSelectLinkPython callable artifactPython (Unknown) DynamoDB Table
delete_item()useDeleteLink

Paginator methods.

Supported API methods 

Link TypeCallerCallee
botocore.client.DynamoDB.Paginator.Query.paginateuseSelectLinkPython callable artifactPython (Unknown) DynamoDB Table
botocore.client.DynamoDB.Paginator.Scan.paginateuseSelectLink

And the boto3 low-level client methods for the DynamoDB database API.

API methods

Link TypeCallerCallee
batch_get_item()useSelectLinkPython callable artifactPython (Unknown) DynamoDB Table
batch_write_item()useInsertLink, useDeleteLink
delete_item()useDeleteLink
delete_table()useDeleteLink
get_item()useSelectLink
put_item()useInsertLink, useDeleteLink, useSelectLink
query()useSelectLink
scan()useSelectLink
transact_get_items()useSelectLink
transact_write_items()useInsertLink, useDeleteLink
update_item()useUpdateLink, useInsertLink, useSelectLink

What results can you expect?

Creation of DynamoDB tables

The two similar create_table() methods provided by boto3 are supported: for the low-level client object and the resource object (as in the example below). 

# https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Python.01.html

import boto3

def create_movie_table(dynamodb=None):
    if not dynamodb:
        dynamodb = boto3.resource('dynamodb', endpoint_url="http://localhost:8000")

    table = dynamodb.create_table(
        TableName='Movies',
        KeySchema=[...],
        AttributeDefinitions=[...],
    )
    return table

Upon resolution of the table name, a Python DynamoDB Table object is created under a Python DynamoDB Database.

Python DynamoDB Database objects are only created if dynamodb tables are present in the results. A single Python DynamoDB Database object is created per project at most. No link is created between the artifact invoking table creation and the resulting table object. However, the bookmark of the table does reflect the corresponding method call.

When the name of a table is not resolved (either because of absence of information or technical limitations) a Python Unknown DynamoDB Table is created instead. A single unknown table is created per project.

Actions on DynamoDB tables

Only actions that have an impact on data in DynamoDB tables are modelized. These actions are represented with CRUD links. In the example below the method batch_write_item() of the low-level client object (DynamoDB) is called. This method can insert new table items or delete them, therefore the presence of the two link types (insertUseLink, deleteUseLink).

# sample_batch_write_item.py
import boto3

TABLE = 'fabric'
dynamodb = boto3.client('dynamodb')

def write_item():
    response = dynamodb.batch_write_item(
        RequestItems = {
          TABLE: [{"PutRequest": { "Item": { ... } }}]
        }
    )


Limitations

  • Accessing tables via tables collections such as "dynamodb.tables.all()" is not supported.
  • The query language PartiQL is not supported (and thus related API calls listed below).
  • The following methods might be supported in the future:

Non-supported

Possible impact
batch_execute_statement()Missing CRUD links to tables (PartiQL)
execute_statement()Missing CRUD links to tables (PartiQL)
execute_transaction()Missing CRUD links to tables (PartiQL)
export_table_to_point_in_time()Missing link to S3 bucket
restore_table_from_backup()Missing table
restore_table_to_point_in_time()Missing table
  • No labels