You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Going through the different db abstractions for Scala I came across Relate. Looks good, but is there a reason the examples are so simple? Please show how to handle joins.
The text was updated successfully, but these errors were encountered:
Queries with joins should work the same as queries without them. For example,
sql"SELECT users.name, emails.email FROM users INNER JOIN emails ON users.id == emails.user_id".asMap { row =>
row.long("name") -> row.string("email")
}
should give you a Map of user names to emails.
The query itself can be any valid SQL query. From the docs:
Relate is a lightweight database access layer for Scala that simplifies database interaction while leaving complete control over the actual SQL query.
There's more documentation on the docs page on how to write queries with parameters, query composition, and data retrieval. For general documentation on writing queries with joins, please refer to SQL documentation.
Please let us know if you run into any issues using any valid queries :)
Going through the different db abstractions for Scala I came across Relate. Looks good, but is there a reason the examples are so simple? Please show how to handle joins.
The text was updated successfully, but these errors were encountered: