document_client 2.0.0 copy "document_client: ^2.0.0" to clipboard
document_client: ^2.0.0 copied to clipboard

The DynamoDB document client simplifies working with items. It uses native Dart types as input parameters, as well as converts response data to native Dart types.

example/example.dart

import 'dart:convert';

import 'package:document_client/document_client.dart';

void main() async {
  final dc = DocumentClient(region: 'eu-west-1');

  final getResponse = await dc.get(
    tableName: 'MyTable',
    key: {'Car': 'DudeWheresMyCar'},
  );

  print(jsonEncode(getResponse.item));
  // e.g. { "wheels": 24, "units": "inch" }

  final batchGetResponse = await dc.batchGet(
    requestItems: {
      'Table-1': KeysAndProjection(
        keys: [
          {
            'HashKey': 'hashkey',
            'NumberRangeKey': 1,
          }
        ],
      ),
      'Table-2': KeysAndProjection(
        keys: [
          {
            'foo': 'bar',
          }
        ],
      ),
    },
  );

  print(jsonEncode(batchGetResponse.responses));
}
8
likes
160
points
146
downloads

Publisher

verified publisheraws-dart.agilord.com

Weekly Downloads

The DynamoDB document client simplifies working with items. It uses native Dart types as input parameters, as well as converts response data to native Dart types.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

aws_dynamodb_api, shared_aws_api

More

Packages that depend on document_client