Download the PHP package rennokki/dynamodb without Composer

On this page you can find all versions of the php package rennokki/dynamodb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dynamodb

CI Latest Stable Version Total Downloads Monthly Downloads codecov StyleCI

Laravel DynamoDB

This package is a fork from the original package by Bao Pham.

For advanced users only. If you're not familiar with Laravel, Laravel Eloquent and DynamoDB, then I suggest that you get familiar with those first.

Install

Install the package using Composer:

If your Laravel package does not support auto-discovery, add this to your config/app.php file:

Publish the config files.

Install (for Lumen)

For Lumen, try this to install the vendor:publish command and load configuration file and enable Eloquent support in bootstrap/app.php:

Usage

Extend your Model

Extend your model with Rennokki\DynamoDb\DynamoDbModel, then you can use Eloquent methods that are supported. The idea here is that you can switch back to Eloquent without changing your queries.

Add Trait to Model (to Sync)

To sync your DB table with a DynamoDb table, use trait Rennokki\DynamoDb\ModelTrait. This trait will call a PutItem after the model is saved, update or deleted.

Query Builder

You can use the query builder facade to build more complex queries.

AWS SDK

AWS SDK v3 for PHP uses guzzlehttp promises to allow for asynchronous workflows. Using this package you can run eloquent queries like save asynchronously on DynamoDb.

Supported features

find() and delete()

Conditions

whereNull() and whereNotNull()

NULL and NOT_NULL only check for the attribute presence not its value being null Please see: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html

all() and first()

Pagination

Unfortunately, offset of how many records to skip does not make sense for DynamoDb. Instead, provide the last result of the previous query as the starting point for the next query.

Examples:

For query such as the following:

Take the last item of this query result as the next "offset":

update()

updateAsync()

save()

saveAsync()

Saving single model asynchronously and waiting on the promise for completion.

Saving multiple models asynchronously and waiting on all of them simultaneously.

delete()

deleteAsync()

chunk()

limit() and take()

firstOrFail()

findOrFail()

refresh()

getItemsCount()

Query Scope

REMOVE — Deleting Attributes From An Item

Please see: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.REMOVE

toSql()

For debugging purposes, you can choose to convert to the actual DynamoDb query

The $raw variable is an instance of RawDynamoDbQuery

Decorate Query

Use decorate when you want to enhance the query.

To set the order of the sort key:

To force to use "Query" instead of "Scan" if the library fails to detect the correct operation:

Indexes

If your table has indexes, make sure to declare them in your model class like so

Note that order of index matters when a key exists in multiple indexes.

For example, for the following query, count_index will be used:

Most of the time, you should not have to do anything but if you need to use a specific index, you can specify it like so

Composite Keys

To use composite keys with your model:

Set $compositeKey to an array of the attributes names comprising the key, e.g.

To find a record with a composite key:

Query Builder

Use DynamoDb facade to build raw queries.

The query builder methods are in the form of set<key_name>, where <key_name> is the key name of the query body to be sent.

For example, to build an UpdateTable query:

Do:

And when ready:

FAQ

Q: Cannot assign id property if its not in the fillable array A: Try this?

Q: How to create migration? A: Please see this issue

Q: How to use with factory? A: Please see this issue

Q: How do I use with Job? Getting a SerializesModels error A: You can either write your own restoreModel or remove the SerializesModels trait from your Job.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of dynamodb with dependencies

PHP Build Version
Package Version
Requires aws/aws-sdk-php Version ^3.142
guzzlehttp/guzzle Version ^6.5|^7.0
illuminate/support Version ^7.30|^8.23
illuminate/database Version ^7.30|^8.23
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rennokki/dynamodb contains the following files

Loading the files please wait ....