Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.
/ dynamap Public archive

DynamoDB object mapper. Like Doctrine or Eloquent, but for DynamoDB.

License

Notifications You must be signed in to change notification settings

brefphp/dynamap

Repository files navigation

DynamoDB object mapper. Like Doctrine or Eloquent, but for DynamoDB.

Build Status Latest Version Total Downloads

This library is currently in an experimental status and is not meant to be used in production.

Installation

composer require bref/dynamap

Usage

$dynamap = Dynamap::fromOptions([
    'region' => 'us-east-1',
], $mapping);

$dynamap->save($myObject);

$myObject = $dynamap->find(MyClass::class, 'key');
$myObject = $dynamap->get(MyClass::class, 'key'); // Same as `find()` but throws an exception if not found

$objects = $dynamap->getAll(MyClass::class);

Mapping example:

$mapping = [
    Article::class => [
        'table' => 'articles',
        'keys' => [
            'id',
        ],
    ],
];

Supported field types:

  • string
  • integer
  • float
  • bool
  • DateTimeImmutable (stored as string)

Contributing

To run tests locally:

  • start DynamoDB local with docker-compose up or docker-compose start
  • run phpunit

About

DynamoDB object mapper. Like Doctrine or Eloquent, but for DynamoDB.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages