/ucengine/src/models/db.erl

http://github.com/AF83/ucengine · Erlang · 11 lines · 9 code · 2 blank · 0 comment · 0 complexity · ec9c7b49f8526ca52959edd6fc80559c MD5 · raw file

  1. -module('db').
  2. -export([get/2]).
  3. -include("uce.hrl").
  4. get(Module, Domain) ->
  5. ?COUNTER(lists:flatten(io_lib:format("db:get:~s", [Module]))),
  6. case config:get(Domain, db) of
  7. undefined -> throw({error, no_database});
  8. _ = Value -> list_to_atom(lists:concat([Module, "_", Value]))
  9. end.