On the Rails app, we can print the record count of a database table by a command like this: rails r "puts User.count" With my knowledge, if we want the same thing on the Phoenix/Ecto environment, we should run such a command: mix run -e "IO.puts SampleApp.Repo.aggregate(SampleApp.User, :count, :id)" That is OK, but is too lengthy for a daily usage. Is there any shorter way?
I have an upsert requirement, so I need to call a postgres stored procedure or use a common table expression. I also use the pgcrypto exgtension for passwords and would like to use postgres functions (such as "crypt" to encode/decode passwords). But I can not find a way to get Ecto to play with raw sql in part or whole, is it intended that ecto will only support the elixir dsl and not allow shelli
I've just started working Elixir & Phoenix today, i am trying to add Ecto as a mapper, but i'm having some trouble using time. This is my model. schema "users" do field :name, :string field :email, :string field :created_at, :datetime, default: Ecto.DateTime.local field :updated_at, :datetime, default: Ecto.DateTime.local end I'm trying to set the created_at and updated_at per default, but when i
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く