Skip to content

Commit

Permalink
Document Repository SQL queries: SELECT
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Oct 25, 2017
1 parent 912df13 commit 4e719f4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/guides/1.1/repositories/sql-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ title: "Guides - Repositories: SQL Queries"
version: 1.1
---

## Select

You can select a subset of columns to be fetched from the database:

```ruby
class UserRepository < Hanami::Repository
def all_with_name
users.select(:id, :name)
end
end
```

## Sort

You can sort records using `#order`:
Expand Down

0 comments on commit 4e719f4

Please sign in to comment.