View Source Sqlcache.Wrapper (sqlcache v1.1.0)

A wrapper for the Sqlcache module.

This module provides a macro for defining cached functions. It also provides a function for deleting cached values.

Example

defmodule MyApp.UsersCached do
  use Sqlcache.Wrapper, namespace: "user"

  defcached get_user(id) do
    MyApp.Users.get_user(id)
  end

  def remove_from_cache(id) do
    del(:get_user, [id])
  end
end

Summary

Functions

Link to this function

cached(namespace, key, fun)

View Source
Link to this macro

defcached(fun_ast, list)

View Source (macro)
Link to this function

del(namespace, fun, args)

View Source