dynoquery 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,7 +34,7 @@ const db = new DynoQuery({
34
34
  User: { pkPrefix: 'USER#' },
35
35
  },
36
36
  indexes: {
37
- ByCategory: { indexName: 'GSI1', pkName: 'GSI1PK', skName: 'GSI1SK', pkPrefix: 'CAT#' }
37
+ ByCategory: { indexName: 'GSI1', pkPrefix: 'CAT#' } // pkName defaults to GSI1PK, skName defaults to GSI1SK
38
38
  }
39
39
  });
40
40
 
@@ -16,8 +16,8 @@ class IndexQuery {
16
16
  this.db = db;
17
17
  this.tableName = config.tableName || db.getTableName() || "";
18
18
  this.indexName = config.indexName;
19
- this.pkName = config.pkName || "GSI1PK";
20
- this.skName = config.skName || "GSI1SK";
19
+ this.pkName = config.pkName || (this.indexName + "PK");
20
+ this.skName = config.skName || (this.indexName + "SK");
21
21
  const globalPrefix = db.getPkPrefix();
22
22
  const indexPrefix = config.pkPrefix || "";
23
23
  let finalPrefix = indexPrefix;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynoquery",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/devspikejs/dynoquery.git"