Is there a Phoenix equivalent to Rails Console

前端 未结 3 1283
无人及你
无人及你 2021-01-31 07:04

I\'m just learning Phoenix and Elixir and I\'m coming from Ruby/Rails where I work in the REPL using pry to inspect my database and application state.

I\'m

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-31 07:19

    You can run iex -S mix to run iex with the dependencies in your current mix project included.. You can read about this at http://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html

    From there you can execute Ecto queries:

    iex> MyApp.Repo.all(MyApp.User)
    

    Running iex -S mix phx.server will also start the phoenix server.

提交回复
热议问题