Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ginger.io/beyonce

Package Overview
Dependencies
Maintainers
16
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ginger.io/beyonce - npm Package Compare versions

Comparing version 0.0.45 to 0.0.46

3

dist/dynamo/Beyonce.d.ts

@@ -5,3 +5,3 @@ import { JayZ } from "@ginger.io/jay-z";

import { QueryBuilder } from "./QueryBuilder";
import { ScanBuilder } from "./ScanBuilder";
import { ParallelScanConfig, ScanBuilder } from "./ScanBuilder";
import { Table } from "./Table";

@@ -22,2 +22,3 @@ import { ExtractKeyType, GroupedModels, TaggedModel } from "./types";

consistentRead?: boolean;
parallel?: ParallelScanConfig;
};

@@ -24,0 +25,0 @@ /** A thin wrapper around the DynamoDB sdk client that

@@ -12,3 +12,8 @@ import { JayZ } from "@ginger.io/jay-z";

consistentRead?: boolean;
parallel?: ParallelScanConfig;
};
export declare type ParallelScanConfig = {
segmentId: number;
totalSegments: number;
};
/** Builds and executes parameters for a DynamoDB Scan operation */

@@ -15,0 +20,0 @@ export declare class ScanBuilder<T extends TaggedModel> extends QueryExpressionBuilder<T> {

@@ -75,3 +75,3 @@ "use strict";

buildScan(options) {
const { table, consistentRead } = this.config;
const { table, consistentRead, parallel } = this.config;
const { expression, attributeNames, attributeValues } = this.build();

@@ -93,2 +93,4 @@ const filterExp = expression !== "" ? expression : undefined;

Limit: options.pageSize,
Segment: parallel === null || parallel === void 0 ? void 0 : parallel.segmentId,
TotalSegments: parallel === null || parallel === void 0 ? void 0 : parallel.totalSegments,
};

@@ -95,0 +97,0 @@ }

{
"name": "@ginger.io/beyonce",
"version": "0.0.45",
"version": "0.0.46",
"description": "Type-safe DynamoDB query builder for TypeScript. Designed with single-table architecture in mind.",

@@ -20,6 +20,6 @@ "main": "dist/index.js",

"libsodium-wrappers": "^0.7.8",
"prettier": "^1.19.1",
"yargs": "^15.3.1"
},
"devDependencies": {
"prettier": "^1.19.1",
"@shelf/jest-dynamodb": "^1.7.0",

@@ -26,0 +26,0 @@ "@types/jest": "^25.1.4",

@@ -277,2 +277,29 @@ # Beyonce

#### Parallel Scans
You can perform "parallel scans" by passing a `parallel` config operation to the `.scan` method,
like so:
```TypeScript
// Somewhere inside of Worker 1
const segment1 = beyonce
.scan({ parallel: { segmentId: 0, totalSegments: 2 }})
.iterator()
for await (const results of segment1) {
// ...
}
// Somewhere inside of Worker 2
const segment2 = beyonce
.scan({ parallel: { segmentId: 1, totalSegments: 2 }})
.iterator()
for await (const results of segment2) {
// ...
}
```
These options mirror the underlying [DynamoDB API](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.ParallelScan)
### BatchGet

@@ -279,0 +306,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc