Sha256: 614921e4b54018a61e78a212e01922ba401d1ffd6ff8e4a5d393966dfaebb2c0

Contents?: true

Size: 1.92 KB

Versions: 8

Compression:

Stored size: 1.92 KB

Contents

# ActiveOrm

[![Gem Version](https://badge.fury.io/rb/active_orm.svg)](http://badge.fury.io/rb/active_orm)
[![Build Status](https://travis-ci.org/drexed/active_orm.svg?branch=master)](https://travis-ci.org/drexed/active_orm)

ActiveOrm is a library for object ruby mapping of different databases.

**Supported:**
  * Redis

**Roadmap:**
 * Cassandra
 * InfluxDB

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'active_orm'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install active_orm

## Table of Contents

* [Redis](#redis)

## Redis

**Configuration:**

**Options:**
 * client: add a custom Redis client

`rails generate active_orm:install` will generate the following file:
`../config/initalizers/active_orm.rb`

```ruby
if defined?(Redis)
  ActiveOrm::Redis.configure do |config|
    config.client = Redis.new(host: '10.0.1.1', port: 6380, db: 15)
  end
end
```

**Usage:**

**Commands:**
 * Geo
 * Hash
 * HyperLogLog
 * Key
 * List
 * PubSub
 * Script
 * Set
 * Sorted Set
 * String
 * Transaction

```ruby
ActiveOrm::Redis::String.create(:month, '01')
ActiveOrm::Redis::String.find(:month)           #=> '01'
ActiveOrm::Redis::String.evaluate.find(:month)  #=> 1

ActiveOrm::Redis::List.create(:user_1, { id: 32123, name: 'James Dean', username: 'alpha123' })
ActiveOrm::Redis::List.find(:user_1)            #=> { id: '32123', name: 'James Dean', username: 'alpha123' }
ActiveOrm::Redis::List.evaluate.find(:user_1)   #=> { id: 32123, name: 'James Dean', username: 'alpha123' }
```

**Rake:**

**Options:**
 * reset: reset current database
 * reset_all: reset all databases

`rake db:redis:reset` and `rake db:redis:reset_all`

## Contributing

Your contribution is welcome.

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
active_orm-5.1.0 README.md
active_orm-5.0.6 README.md
active_orm-5.0.5 README.md
active_orm-5.0.4 README.md
active_orm-5.0.3 README.md
active_orm-5.0.2 README.md
active_orm-5.0.1 README.md
active_orm-5.0.0 README.md