All Projects → akdilsiz → elixir-rediscl

akdilsiz / elixir-rediscl

Licence: MIT license
A minimal redis client with connection pooling for elixir

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to elixir-rediscl

tinypool
🧵 A minimal and tiny Node.js Worker Thread Pool implementation (38KB)
Stars: ✭ 452 (+3666.67%)
Mutual labels:  minimal
cj5
Very minimal single header JSON5 parser in C99, derived from jsmn
Stars: ✭ 33 (+175%)
Mutual labels:  minimal
marathon
minimal run-or-focus launcher for Linux/X
Stars: ✭ 54 (+350%)
Mutual labels:  minimal
kolorist
A tiny utility to colorize stdin/stdout
Stars: ✭ 160 (+1233.33%)
Mutual labels:  minimal
siimple
The minimal and themeable CSS toolkit for flat and clean designs
Stars: ✭ 525 (+4275%)
Mutual labels:  minimal
bento
Bento Toolkit is a minimal fedora-based container for penetration tests and CTF with the sweet addition of GUI applications.
Stars: ✭ 74 (+516.67%)
Mutual labels:  minimal
Hypermarket
If you are looking for a stylish and elegant website template for your online store, Hypermarket is the perfect choice for you.
Stars: ✭ 49 (+308.33%)
Mutual labels:  minimal
nebula-ui
A beautifully minimal, subtly animated, and carefully-designed Atom UI theme with innovative new ideas.
Stars: ✭ 41 (+241.67%)
Mutual labels:  minimal
Ephesus
Ephesus is a minimalist Jekyll theme, designed for personal blog use.
Stars: ✭ 40 (+233.33%)
Mutual labels:  minimal
pure
Beautifully crafted minimalistic loading animations.
Stars: ✭ 14 (+16.67%)
Mutual labels:  minimal
dradis-docker
A Docker image with Dradis: A collaboration and reporting platform for IT security experts.
Stars: ✭ 13 (+8.33%)
Mutual labels:  minimal
minimum-viable-startpage
A very simple startpage to replace new tab in a browser of choice.
Stars: ✭ 61 (+408.33%)
Mutual labels:  minimal
pro-writer
Minimal yet Pro Writer 🚀
Stars: ✭ 22 (+83.33%)
Mutual labels:  minimal
akka-cluster-minimal
Akka Cluster - absolute minimal
Stars: ✭ 16 (+33.33%)
Mutual labels:  minimal
mahler.c
Western music theory library in C99
Stars: ✭ 13 (+8.33%)
Mutual labels:  minimal
air
A hyper-minimal WordPress starter theme for developers built with Tailwind CSS.
Stars: ✭ 45 (+275%)
Mutual labels:  minimal
the-roots-home
I am not root, this is a hugo theme.
Stars: ✭ 29 (+141.67%)
Mutual labels:  minimal
axyl-iso
Axyl is a Linux distro centered on tiling window managers. Choose from i3, bspwm, dwm and more.
Stars: ✭ 348 (+2800%)
Mutual labels:  minimal
jot
Command-line note-taking for minimalists
Stars: ✭ 24 (+100%)
Mutual labels:  minimal
gatsby-portfolio
Portfolio / Personal Website - Built with Gatsby.js and Published at konstantin.digital
Stars: ✭ 23 (+91.67%)
Mutual labels:  minimal

Elixir Redis Client

A minimal redis client with connection pooling (using eredis and poolboy)

Codacy Badge Build Status Coverage Status Hex.pm Hex.pm

##TODO List

  • Completed docs
  • All redis commands will be added.

Features

  • Connection pooling
  • Pipe query builder (basic commands)
  • Basic Query commands

Installation

available in Hex, the package can be installed by adding rediscl to your list of dependencies in mix.exs:

def deps do
  [
    {:rediscl, "~> 0.1"}
  ]
end

Documentation

available HexDocs.

Configuration

config :rediscl,
    host: "127.0.0.1",
    port: 6379,
    database: 0,
    pool: 15,
    timeout: 15_000

If do you are using json library?

config :rediscl,
  json_library: Jason

Examples

defmodule Example do
    alias Rediscl

    def example_one do
        {:ok, _} = Rediscl.Query.set("key:1", "value1")
    end

    def example_two do
        {:ok, value} = Rediscl.Query.get("key:1")
    end

    def example_three do
        {:ok, list_values} = Rediscl.Query.mget(["key:1", "key:2", "key:3"])
    end

    def example_jsonable_one do
      ## If you are only going to use it with a key for response
      ## For this example, options are given based on the Jason library.
      {:ok, _} =
        Rediscl.Query.get(%{key: 1}, 
          [{:json_response, true}, {:json_response_opts, [{:keys, :atoms!}]}])
    end
    
    def example_jsonable_two do
      ## If you are only going to use it with key and value.
      {:ok, _} =
        Rediscl.Query.set(%{key: 1}, %{value: 1}, 
          [{:jsonable, true}, {:encode_key, true}])
    end

    def example_jsonable_three do
      ## If you're going to use a query with a lot of keys and a value.
      {:ok, _} =
        Query.smove(%{key: 2}, %{key: 1}, "value3",
          [{:jsonable, true}, {:encode_multiple_keys, true}])
    end

    def example_jsonable_four do
      ## If you're going to use a query with a lot of keys.
      {:ok, _values} = 
        Query.sunion([%{key: 1}, "key:2"],
          [{:jsonable, true}, {:encode_multiple_keys, true}])
    end    
end

defmodule ExamplePipeBuilder do
    import Rediscl.Query.Pipe
    alias Rediscl.Query

    def example do
        query = begin set: ["key:10", "1"],
                      mset: ["key:11", "value2", "key:12", "value3"],
                      lpush: ["key:13", ["-1", "-2", "-3"]],
                      rpush: ["key:14", ["1", "2", "3"]],
                      lrange: ["key:13", 0, "-1"],
                      lrem: ["key:13", 1, "-1"]

        {:ok, results} = Query.run_pipe(query)
    end
end

Use rediscl for Mix.Task

import Mix.Rediscl
alias Rediscl

def run(_) do
    Mix.Task.run "app.start"
    
    ### Your codes
    Rediscl.Query.set("key:1", "value1")
    ### Your codes
end

Contribution

All contributions are welcomed as long as you follow the conventions of Elixir language.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].