Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select all rows from table?

Tags:

slick

As subject says, how to query a table without condition (WHERE clause)?

For example, LookupTable.filter(r => true) (this doesn't work of course)

Thank you

like image 256
user1661898 Avatar asked Dec 23 '16 06:12

user1661898


1 Answers

Basically what you need to do is to use this:LookupTable.result.

In fact this is exactly one of the first code samples in Slick documentation "Getting started section" here: http://slick.lightbend.com/doc/3.1.1/gettingstarted.html#querying

As there is no code pasted in your question I can only assume that you are aware of that you need to use db.run(...) to fire you DBIO (generated by this result call).

like image 93
Paul Dolega Avatar answered Sep 27 '22 23:09

Paul Dolega