Skip to content

Instantly share code, notes, and snippets.

@weixiyen
Created January 2, 2018 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weixiyen/e70ce50a1cd0648026542604b2e194aa to your computer and use it in GitHub Desktop.
Save weixiyen/e70ce50a1cd0648026542604b2e194aa to your computer and use it in GitHub Desktop.
User
|> prepared(user_id: id)
|> select([:user_id, :username])
|> where(user_id: :user_id)
|> User.one
User
|> select([:user_id, :username])
|> where(user_id: [in: [1, 2, 3]])
|> limit(10)
|> User.all
UserByEmail
|> select([:display_name])
|> where(email: "someone@gmail.com")
|> User.one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment