document_client 0.0.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 62

DocumentClient for DynamoDB #

The document client simplifies working with items in Amazon DynamoDB by abstracting away the notion of attribute values. This abstraction annotates native Dart types supplied as input parameters, as well as converts annotated response data to native Dart types.

Warning: This is library is under development, some operations may not work.

Contributors #

0.0.7 #

  • Fix null value error for 'expected' parameter in 'put' method

0.0.6 #

  • Added support for AttributeValues for the translator for the DocumentClient

0.0.5 #

  • Add missing return statement in type translator

0.0.4 #

  • Fix crashes because of null parameters

0.0.3 #

  • Shorten description to make Pub happy

0.0.2 #

  • Fix bugs in transactWrite
  • Add LICENSE
  • Add proper example file
  • More thorough description

0.0.1 #

  • Initial version

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));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  document_client: ^0.0.7

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:document_client/document_client.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
29
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
aws_dynamodb_api ^0.0.3 0.0.3
shared_aws_api ^0.1.8 0.1.8
Transitive dependencies
charcode 1.1.3
collection 1.14.13
convert 2.1.1
crypto 2.1.5
http_parser 3.1.4
intl 0.16.1
json_annotation 3.0.1
meta 1.1.8
path 1.7.0
petitparser 3.0.4
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0
xml 4.2.0
Dev dependencies
http any 0.12.1
pedantic ^1.9.0 1.9.0 1.9.1
test ^1.15.1