How to create macro to implement get function of Ecto?