{"id":17933598,"url":"https://github.com/matrix86/amazon-dynamodb-wrapper","last_synced_at":"2025-09-22T07:31:50.475Z","repository":{"id":83194449,"uuid":"42944234","full_name":"Matrix86/Amazon-DynamoDB-Wrapper","owner":"Matrix86","description":"Another Amazon DynamoDB PHP Wrapper For AWS SDK V3","archived":false,"fork":false,"pushed_at":"2020-10-27T13:49:28.000Z","size":1213,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T22:04:55.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Matrix86.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-22T15:54:23.000Z","updated_at":"2020-12-04T18:03:26.000Z","dependencies_parsed_at":"2023-07-02T06:04:54.253Z","dependency_job_id":null,"html_url":"https://github.com/Matrix86/Amazon-DynamoDB-Wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matrix86%2FAmazon-DynamoDB-Wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matrix86%2FAmazon-DynamoDB-Wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matrix86%2FAmazon-DynamoDB-Wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matrix86%2FAmazon-DynamoDB-Wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Matrix86","download_url":"https://codeload.github.com/Matrix86/Amazon-DynamoDB-Wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233832511,"owners_count":18737210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T21:40:52.793Z","updated_at":"2025-09-22T07:31:44.904Z","avatar_url":"https://github.com/Matrix86.png","language":"PHP","readme":"# Amazon-DynamoDB-Wrapper\n## Another Amazon DynamoDB PHP Wrapper For AWS SDK V3\n\n\nThis is an object wrapper for Amazon DynamoDB SDK. It helps to manipulate the items that you can use with DynamoDB.\n\n## Getting Started\n### Include the library\n\n```php\nrequire(\"Amazon\\DynamoDB\\AutoLoader.php\");\n```\n\n### Create Connection\n```php\n$dc = new \\Amazon\\DynamoDB\\AmazonDynamoDB($key, $secret, $region);\n```\n\n### Manage tables\n\u003e Work in progress\n\n### Add item\n```php\n$item = new \\Amazon\\DynamoDB\\Item('TABLENAME');\n$item['numericAttribute'] = 3;\n$item['stringAttribute'] = '3';\n$item['NumericListAttribute'] = array(\n  1,2,3\n);\n$item['StringListAttribute'] = array(\n  'a', 'b', 'c'\n);\n\n$item['MapAttribute'] = array(\n  'a' =\u003e 2,\n  'b' =\u003e 'string'\n);\n\n//! Setting Condition Expression\n$ctx = new \\Amazon\\DynamoDB\\Context\\AddItem();\n$ctx-\u003eSetConditionExpression(\"attribute_not_exists('numericAttribute')\");\n\n$dc-\u003eAddItem($item)\n```\n\n### Get item\n```php\n$item = new \\Amazon\\DynamoDB\\Item('TABLENAME');\n$item['primary'] = 3;\n$item['range'] = 1;\n\n$res = $dc-\u003eGetItem( $item );\n\n```\n\n### Update item\n```php\n$item = new \\Amazon\\DynamoDB\\Item('TABLENAME');\n$item['primary'] = 3;\n$item['range'] = 1;\n\n$updateCtx = new \\Amazon\\DynamoDB\\Context\\UpdateItem();\n\n//! Section Set allows you to update data with the values that you specify\n$updateCtx-\u003eSetSectionSet(\"var = var + 1, var2 = 0\");\n\n//! Section Remove allows you to remove an attribute to the item\n$updateCtx-\u003eSetSectionRemove(\"var3\");\n\n//! Section add allows you to add a value to a numeric attribute or set\n$updateCtx-\u003eSetSectionAdd(\"var4 1\");\n\n//! Set the return values\n$updateCtx-\u003eSetReturnValues(\"ALL_OLD\");\n\n$res = $dc-\u003eUpdateItem( $item, $updateCtx );\n\n```\n\nFrom DynamoDB documentation\n\u003eUse ReturnValues if you want to get the item attributes as they appeared either before or after they were updated. For UpdateItem, the valid values are:\n\u003e\n* NONE - If ReturnValues is not specified, or if its value is NONE, then nothing is returned. (This setting is the default for ReturnValues.)\n* ALL_OLD - If UpdateItem overwrote an attribute name-value pair, then the content of the old item is returned.\n* UPDATED_OLD - The old versions of only the updated attributes are returned.\n* ALL_NEW - All of the attributes of the new version of the item are returned.\n* UPDATED_NEW - The new versions of only the updated attributes are returned.\n\n\n### Delete item\n\u003e Work in progress\n\n### Perform a query\n```php\n$item = new \\Amazon\\DynamoDB\\Context\\Query('TABLENAME');\n$query-\u003eSetConsistentRead(true);\n$query-\u003eSetKeyConditionExpression('id = \"1201\"', 'dateday BETWEEN \"2015-09-13\" AND \"2015-09-18\"');\n$res = $dc-\u003eQuery($query);\n\n```\n\n### Perform a scan\n```php\n$query = new \\Amazon\\DynamoDB\\Context\\Scan('TABLENAME');\n$res = $dc-\u003eScan($query);\n```\n\n### Get Consumed Capacity\n```php\n//! Get the Consumed capacity units used for read all tables\n$dc-\u003eGetReadConsumedCapacityUnits();\n\n//! Get the Consumed capacity units used for read a single table\n$dc-\u003eGetReadConsumedCapacityUnits('TABLENAME');\n\n//! Get the Consumed capacity units used for write on all tables\n$dc-\u003eGetWriteConsumedCapacityUnits();\n\n//! Get the Consumed capacity units used for write on a single table\n$dc-\u003eGetWriteConsumedCapacityUnits('TABLENAME');\n\n//! Reset All the consumed Capacity Units\n$dc-\u003eClearConsumedCapacityUnits();\n\n//! Reset the consumed Capacity Units on a specific table\n$dc-\u003eClearConsumedCapacityUnits('TABLENAME');\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrix86%2Famazon-dynamodb-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrix86%2Famazon-dynamodb-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrix86%2Famazon-dynamodb-wrapper/lists"}