Comparing version 0.2.2 to 0.2.3
@@ -1,2 +0,1 @@ | ||
var db = require('../db') | ||
@@ -3,0 +2,0 @@ module.exports = function deleteTable(store, data, cb) { |
@@ -1,2 +0,1 @@ | ||
var db = require('../db') | ||
@@ -3,0 +2,0 @@ module.exports = function describeTable(store, data, cb) { |
@@ -13,3 +13,3 @@ var once = require('once'), | ||
opts = {}, vals, itemDb = store.getItemDb(data.TableName), | ||
size = 0, capacitySize = 0, lastItem | ||
size = 0, capacitySize = 0, count = 0, lastItem | ||
@@ -87,3 +87,2 @@ hashKey = table.KeySchema[0].AttributeName | ||
vals = vals.filter(function(val) { | ||
if (!db.matchesFilter(val, data.KeyConditions)) { | ||
@@ -94,4 +93,12 @@ if (lastItem) lastItem = null | ||
if (size > 1042000) return false | ||
lastItem = val | ||
return true | ||
}) | ||
vals = vals.takeWhile(function(val) { | ||
// Limits don't currently work for traversing index in reverse | ||
if ((data.ScanIndexForward !== false && count >= data.Limit) || size > 1042000) return false | ||
size += db.itemSize(val, true) | ||
count++ | ||
@@ -102,3 +109,2 @@ // TODO: Combine this with above | ||
lastItem = val | ||
return true | ||
@@ -105,0 +111,0 @@ }) |
@@ -35,6 +35,5 @@ var once = require('once'), | ||
if (data.Limit) vals = vals.take(data.Limit) | ||
vals = vals.takeWhile(function(val) { | ||
if (scannedCount >= data.Limit || size > 1042000) return false | ||
vals = vals.filter(function(val) { | ||
if (size > 1042000) return false | ||
scannedCount++ | ||
@@ -49,7 +48,8 @@ size += db.itemSize(val, true) | ||
if (!data.ScanFilter) return true | ||
return db.matchesFilter(val, data.ScanFilter) | ||
return true | ||
}) | ||
if (data.ScanFilter) | ||
vals = vals.filter(function(val) { return db.matchesFilter(val, data.ScanFilter) }) | ||
if (data.AttributesToGet) { | ||
@@ -56,0 +56,0 @@ vals = vals.map(function(val) { |
{ | ||
"name": "dynalite", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A mock implementation of Amazon's DynamoDB built on LevelDB", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -68,5 +68,6 @@ dynalite | ||
- Allow for other persistence types (LevelDOWN-Hyper, etc) | ||
- Use efficient range scans for Query calls | ||
- Use efficient range scans for `Query` calls | ||
- Explore edge cases with `Query` and `ScanIndexForward: false` (combine with above) | ||
- Implement `ReturnItemCollectionMetrics` on all remaining endpoints | ||
- Is the ListTables limit of names returned 100 if no Limit supplied? | ||
- Is the `ListTables` limit of names returned 100 if no `Limit` supplied? | ||
@@ -76,11 +77,13 @@ Problems with Amazon's DynamoDB Local | ||
We've run into trouble using the current version of the DynamoDB Local Java tool (2013-09-12) when trying to test | ||
our production code, especially in a manner that simulates actual behaviour on the live instances. | ||
Part of the reason I wrote dynalite was due to the existing mock libraries not exhibiting the same behaviour as the | ||
live instances. Amazon released their DynamoDB Local Java tool recently, but the current version (2013-09-12) still | ||
has quite a number of issues that have prevented us (at [Adslot](http://adslot.com/)) from testing our production code, | ||
especially in a manner that simulates actual behaviour on the live instances. | ||
Some of these are documented (eg, no ConsumedCapacity returned), but most aren't - | ||
the items below are a rough list of the issues we've found, vaguely in order of importance: | ||
Some of these are documented (eg, no `ConsumedCapacity` returned), but most aren't - | ||
the items below are a rough list of the issues we've found (and do not exist in dynalite), vaguely in order of importance: | ||
- Returns 400 when `UpdateItem` uses the default `PUT` Action without explicitly specifying it | ||
- Returns 400 when `UpdateItem` uses the default `PUT` `Action` without explicitly specifying it | ||
(this actually prevents certain client libraries from being used at all) | ||
- Does not return correct number of `UnprocessedKeys` in `BatchGet` (one less!) | ||
- Does not return correct number of `UnprocessedKeys` in `BatchGet` (returns one less!) | ||
- Returns 400 when trying to put valid numbers with less than 38 significant digits, eg 1e40 | ||
@@ -90,4 +93,4 @@ - Returns 200 for duplicated keys in `BatchGetItem` | ||
- Returns 200 when range key is too big in `GetItem`/`BatchGetItem` | ||
- Returns 200 for `PutItem`/`GetItem`/`UpdateItem`/`BatchGetItem`/`Scan`/etc with empty strings (eg, {a: {S: ''}}) | ||
- Returns 413 when request is over 1MB (eg, in a `BatchWrite`), but live instances allow 8MB | ||
- Returns 200 for `PutItem`/`GetItem`/`UpdateItem`/`BatchGetItem`/`Scan`/etc with empty strings (eg, `{a: {S: ''}}`) | ||
- Returns 413 when request is over 1MB (eg, in a `BatchWrite` with 25 items of 64k), but live instances allow 8MB | ||
- Returns `ResourceNotFoundException` in `ListTables` if `ExclusiveStartName` no longer exists | ||
@@ -94,0 +97,0 @@ - Does not return `ConsistentRead` property in `UnprocessedKeys` in `BatchGet` even if requested |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105562
88378
2607
118