> (defn get-users [] [:susan :kwan])
>
> (defn what-is-this-function [f] ((resolve (symbol f))))
> (what-is-this-function "get-users")
>[:susan :kwan]
In an uberjar this does not work. I read somewhere that the runtime name-space is different than the REPL namespace and different from the namespace that exists while the compiler compiles the code.
So how do I resolve the symbol correctly?
I have functions that call a MySQL database, and each function is named after a database table. Most of the mechanics of the call are the same, the only thing different is the SQL. So I have functions such as "company" and "user" and "product". I also have a function called (select). I call select with one of the other functions, given as a string:
(select "product")
Inside of (select) I need to turn "product" into a resolved symbol that I can call.
Afterwards, I store the results in a map in an atom. I want to use the database names as the keys. So "product" should be the key that holds the results of the function "product".
But what I need to do to correctly resolve the string to a function?