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

active-dynamo

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

active-dynamo

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

active-dynamo

An ActiveRecord like ODM for AWS DynamoDB

Installation

gem install active-dynamo

Usage

Currently, the supported operations are as follows:

  • Define a model in a way similar to ActiveRecord, calling table_name and attributes functions:
class Account < ActiveDynamo::Base
  table name: 'account', partition_key: :no, sort_key: :balance
  attributes no: Integer, balance: Integer, kind: String
end
  • Create a new record:
account = Account.new(no: 123, balance: 2000, kind: 'current')
account.save

# or use `create`
account = Account.create(no: 123, balance: 2000, kind: 'current')
  • Query the table using methods such as:
Account.all

Account.where(no: 123, balance: 2000)
Account.where("no = 123 and balance >= 2000 and kind = 'current'")

Account.find(no: 123, balance: 2000)
  • Update a record
account = Account.first
account.update(kind: 'savings')
  • Delete a record
Account.destroy(no: 123, balance: 2000)

License

See LICENSE.

FAQs

Package last updated on 18 Oct 2020

Did you know?

Socket

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.

Install

Related posts

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