Closed devinivy closed 9 years ago
Thank you for your effort. I get an error while testing this code:
server-1 (err): indexName = columnName;
server-1 (err): ^
server-1 (err): ReferenceError: columnName is not defined
server-1 (err): at Object.module.exports.adapter._parseIndex (/var/www/server/node_modules/sails-dynamodb/index.js:298:21)
Sorry, that was a silly oversight! It's a simple fix– I'll update soon.
Should be resolved– let me know if it gives you any more issues. I expect it will not work with your current configuration, as
someName: {
index: true
}
currently implies the key name is someName
(the name of the column). It can be adjusted by using
someName: {
index: 'someIndexName-hash'
}
using any index someIndexName
.
Can you add it to readme file so it would be documented?
Do these additions seem adequate?
I added a fix for endpoint while using a local dynamoDB and made changes to the model but I keep getting "Specified index is not part of table" for a model that does not have an index. Can you check?
This occurs during a find
?
This bug should be resolved now.
Creating a new record without specifying an id produces error: create error: { [Error: the value of id is not allowed to be undefined]
I see that Vogels has an autogenerating UUID type– are you expecting to use that in a certain scenario? How should your primary key attribute be configured in order to use Vogels' UUID type? Some users may want their primary key hash to be something other than a UUID.
Yes, It is part of sails framework activated by autoPK setting http://sailsjs.org/#/documentation/concepts/ORM/model-settings.html
Okay, here's how I added autoPk
support:
autoPk
default to "string"
Because autoPk
creates an auto-incrementing string attribute in the collection definition, it will become a UUID. How does that seem to you?
Yes that is how it is currently working on master.
Did that last commit make it work for you?
Yes it does not seem to solve the problem
server (err): /var/www/server/node_modules/sails/node_modules/waterline/lib/waterline/error/WLError.js:36 server (err): this.rawStack = (this._e.stack.replace(/^Error(\r|\n)*(\r|\n)*/, '')); server (err): ^ server (err): TypeError: Cannot call method 'replace' of undefined server (err): at new WLError (/var/www/server/node_modules/sails/node_modules/waterline/lib/waterline/error/WLError.js:36:34)
It is working for me. I'll take a closer look, though. We should try to write some tests.
I'm also confused, as that stack trace does not include any files in sails-dynamodb.
I made tons of updates here. It definitely resulted in breaking changes. But I think I've added many features and made the adapter function more naturally. If you'd rather not make such breaking changes now, that's understandable! Here's what I did:
index: 'IndexName-hash'
andindex: 'IndexName-range'
. Similarly, you specify primary keys asprimaryKey: 'hash'
andprimaryKey: 'range'
.index: 'secondary'
. In that case, Vogels assumes that the index name is the name of the field, which the adapter respects._vogelsReferences
. To avoid confusion, I renamed_modelReferences
to_collectionReferences
.keyId
(since the name is created once explicitly for the table) or name indices usingindexPrefix
(because it seems like an unnecessary limitation).updatedAt
andcreatedAt
in the adapter. Standard waterline collection configurations should be able to deal with that.find
automatically uses the most relevant index with the following precedence,update
performs updates using conditional checks, so you can use conditions other than key conditions.