dwyl/phoenix-ecto-append-only-log-example

Questions on approach taken

开放

#8 创建于 2018年10月9日

 (8 条评论) (1 个反应) (1 位负责人)Elixir (5 个派生)auto 404
help wantedquestiontechnical

仓库指标

星标
 (82 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

  • Why is everything done using macros? We could achieve the same result by making them regular functions which takes the relevant module as an argument. Is there any benefits of one approach vs the other?

  • Is the insert function just allowing the user to skip the step where they call the relevant changeset function? Is this a good idea?

    • When inserting into the database in this way will a user only ever need on changeset function? In a regular Phoenix application there may be multiple changesets depending on what needs to be inserted/updated in the database. If a user needs to change their password for example there could be a changeset that deals specifically with just this. (Just to be clear, I cannot actually think of a situation with this approach where a user might need more than one changeset function but thought it best to raise the point in case I have missed something)
  • The get and get_by functions seem to just call their Repo equivalents. Are they needed?

贡献者指南