![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
An interface for AWS DynamoDB with helper functions
npm install --save dynamomo
// import
import table from 'dynamomo'
// import
import dynamomo from 'dynamomo'
// Configure table with stage
dynamomo.config({
tablePrefix: stage, // takes care of prefixing for different stages
debug: true // outputs dynamodb usage information as you query
})
Create a new table instance. This does not "create" the table. Only the binding to the table.
Options available
Id
if not specified// Access the root table by name. For the prod-items table, just user the name items
// This will handle prefixing for prod-items, int-items, and dev-items on it's own
const items = dynamomo.create('items')
// With a specified primary key
const items = dynamomo.create('items', { primaryKey; 'ItemPublicKey' })
// With a specified index key
const items = dynamomo.create('items', { indexName; 'ItemPublicKey-index' })
Retrieve a record using the Id field of the table, or other named Id field
NOTE: If item is not found, the promise will resolve successfully with a response of undefined
// Uses the primary key Id by default
dynamomo('items').getById(1)
Retrieve all the records for a table. This handles the recursive actions needed for DynamoDB to get all records
dynamomo('items').getAll() // alias for scan
Retrieve all the records of a table from an array of Ids. Uses DynamoDB batch get to retrieve the records. DyanamoDB limits the result to 100 records, so if more than 100 IDs are requested, the function will make a separate request for every set of 100 IDs.
"Yo dawg, I heard you like batch requests. So we put a batch request on your batch request so you can get all your records while getting some records"
dynamomo('items').getAllById([1, 2, 3, 4])
Update a record's data by specifying it's Id and the attributes to update. Provide additional dynamo client parameters as needed
const id = 1
const updateKeys = { EmailAddress: 'newemail@email.com' }
const addParams = { ReturnValues: 'UPDATED_NEW' }
dynamomo('items').updateById(id, updateKeys, addParams)
DynamoDB query operation. Could use more love and testing.
dynamomo('items').query(params)
DynamoDB update operation. Could use more love and testing.
dynamomo('items').update(dynamoUpdateParams)
DyanamoDB scan operation. This handles the recursive actions needed for DynamoDB to get all records
dynamomo('items').scan(params)
Delete a record's data by specifying its Id. Provide additional dynamo client parameters as needed
dynamomo('items').deleteById(1)
Any batch commands such as scan or query can take a specialized MaxLimit
property to control the amount of records pulled. This is different than the Limit
property used by Dynamodb. MaxLimit will make recursive calls until it retrieves the MaxLimit
value, or if it reaches the end of the table rows.
Since MaxLimit
is not a property allowed by Dynamodb, the property is removed from the config when the passed to the Dynamodb client.
Example with getAll/scan
const items = await dynamomo('items').getAll({
MaxLimit: 300,
ProjectionExpression: 'ItemName, Category'
})
// the items result will be an object
{
Items: [ ... ], // 300 items from the database
LastEvaluatedKey: { Id: 123 }, // Where the query ended when it reached the limit. LastEvaluatedKey can change as the table size changes.
RowCount: 300 // Total rows return
}
Example with queryByKeys
const items = await dynamomo('items').queryByKeys({
CategoryId: '2'
}, {
MaxLimit: 2,
ProjectionExpression: 'ItemName, Category'
})
FAQs
Dynamodb query helper
The npm package dynamomo receives a total of 65 weekly downloads. As such, dynamomo popularity was classified as not popular.
We found that dynamomo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.