github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

nrk / redis-lua

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 8
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • commands_pipelining
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A Lua client library for the redis key value storage system. — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Fixed a typo in the definition of ZINCRBY 
nrk (author)
Fri Nov 20 14:07:20 -0800 2009
commit  b2b66bec6bb2e4927438fda633bbc631a63aaf5b
tree    4a02bd0c3934cfb116168b00fb233fc06aa41b1b
parent  6706bec59a0968177247d00bdc4cd86615f6b952
redis-lua /
name age
history
message
file LICENSE Tue Mar 24 04:46:10 -0700 2009 Just added the LICENSE file [nrk]
file README Sat Aug 29 09:54:12 -0700 2009 First batch of tests for redis-lua created usin... [Daniele Alessandri]
file redis.lua Fri Nov 20 14:07:20 -0800 2009 Fixed a typo in the definition of ZINCRBY [nrk]
directory spec/ Sun Nov 01 11:53:40 -0800 2009 Implemented the STORE parameter for SORT (redis... [nrk]
README
redis-lua
-------------------------------------------------------------------------------

A Lua client library for the redis key value storage system.


== USAGE:

  * Include redis-lua in your script:

    require 'redis'

  * Connect to a redis-server instance and send a PING command:

    local redis = Redis.connect('127.0.0.1', 6379)
    local response = redis:ping()           -- true

  * Set and get a key+value:

    redis:set('usr:nrk', 10)
    redis:set('usr:nobody', 5)
    local value = redis:get('usr:nrk')      -- 10

  * Increment and decrement integer values:

    redis:increment('usr:nrk')              -- 11
    redis:decrement_by('usr:nobody', 3)     -- 2

  * Return all the keys matching the specified pattern:

    local keys = redis:keys('usr:*')        -- {'usr:nrk','usr:nobody'}

  * Sort list values by using various parameters supported by the server:

    for _,v in ipairs({ 10,3,2,6,1,4,23 }) do 
        redis:push_tail('usr:nrk:ids',v)
    end

    local sorted = redis:sort('usr:nrk:ids', { 
         sort = 'asc', alpha = true, limit = { 1, 5 }
    })      -- {1= 10, 2= 2 , 3= 23, 4= 3, 5= 4}

  * Get infos from the server:

    for k,v in pairs(redis:info()) do print(k .. ' => ' .. v) end
    --[[
        total_connections_received => 5
        db0 =>  keys=8,expires=0
        uptime_in_days => 0
        uptime_in_seconds => 16
        connected_slaves => 0
        connected_clients => 1
        role => master
        last_save_time => 1245612714
        used_memory => 3378
        total_commands_processed => 14
        changes_since_last_save => 10
        bgsave_in_progress => 0
        redis_version => 0.900
    ]]


== TODO:

  * improve methods such as connect and get_multiple
  * redis-lua actually needs more error-checking code
  * complete the test suite
  * write more docs


== REQUIREMENTS:

  * LuaSocket: http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
  * Telescope (required by the test suite): http://telescope.luaforge.net/
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server