1.0.0 • Published 1 year ago

@declanprice/dynostore v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Dynostore

Dynostore is a minimal no magic query builder for dynamodb, it's a simple layer on top of the native dynamodb AWS V3 SDK API.

// QueryItems

await store.query<CustomerInvoiceItem>()
  .pk(eq('id', 'customer-1'))
  .sk(beginsWith('sk', 'invoice-'))
  .exec()
// GetItem

await store.get<CustomerItem>()
  .key({ id: customer.id })
  .exec()
// UpdateItem

await store
  .update()
  .key({ id: customer.id })
  .update(set('firstName', 'john'), set('lastName', 'doe'), increment('version', 1))
  .condition(notExists('id'), or(), eq('name', 'john'))
  .exec()
// PutItem

await store.put<CustomerItem>()
  .item({ id: 'customer-1', name: 'declan' })
  .exec()
// DeleteItem

await store
  .delete()
  .key({ id: 'customer-1' })
  .exec()
// ScanItems

await store.scan<any>()
  .filter(eq('name', 'john'))
  .exec()

See Documentation for more in depth usage.

1.0.0

1 year ago

0.0.13

1 year ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago