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
Copy file name to clipboardExpand all lines: tutorial/index.html
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -33,19 +33,19 @@ <h2>Run the App and the Tests</h2>
33
33
<h2>Project Setup</h2>
34
34
35
35
<p>
36
-
Slick is a library that is easy to include in any project. This project uses the sbt build tool so the dependency for Slick is specified in the <ahref="#code/build.sbt" class="shortcut">build.sbt</a> file. To make things simple this project uses the H2 database in-memory. <ahref="http://slick.typesafe.com/doc/2.0.0-M3/connection.html" target="_blank">Learn more about connecting to other databases in the Slick docs</a>.
36
+
Slick is a library that is easy to include in any project. This project uses the sbt build tool so the dependency for Slick is specified in the <ahref="#code/build.sbt" class="shortcut">build.sbt</a> file. To make things simple this project uses the H2 database in-memory. <ahref="http://slick.typesafe.com/doc/2.1.0-M2/connection.html" target="_blank">Learn more about connecting to other databases in the Slick docs</a>.
37
37
</p>
38
38
</div>
39
39
40
40
<div>
41
41
<h2>Schema / Table Mapping</h2>
42
42
43
43
<p>
44
-
The <ahref="#code/src/main/scala/Tables.scala" class="shortcut">Tables.scala</a> file contains the mappings for a <code>Suppliers</code> and a <code>Coffees</code> table. These <code>Table</code> create a mapping between a database table and a class. The table's columns are also mapped to functions. This mapping is called <ahref="http://slick.typesafe.com/doc/2.0.0/introduction.html#lifted-embedding" target="_blank">Lifted Embedding</a> since the types of a column mappings are not the actual column value's type, but a wrapper type. For a column that contains a <code>Double</code> value the type of mapping will be <code>Column[Double]</code>. This enables type-safe queries to be built around meta-data and then executed against the database.
44
+
The <ahref="#code/src/main/scala/Tables.scala" class="shortcut">Tables.scala</a> file contains the mappings for a <code>Suppliers</code> and a <code>Coffees</code> table. These <code>Table</code> create a mapping between a database table and a class. The table's columns are also mapped to functions. This mapping is called <ahref="http://slick.typesafe.com/doc/2.1.0-M2/introduction.html#lifted-embedding" target="_blank">Lifted Embedding</a> since the types of a column mappings are not the actual column value's type, but a wrapper type. For a column that contains a <code>Double</code> value the type of mapping will be <code>Column[Double]</code>. This enables type-safe queries to be built around meta-data and then executed against the database.
45
45
46
46
Using a table mapping object requires creating a <code>TableQuery</code> instance for the <code>Table</code> classes. In <ahref="#code/src/main/scala/HelloSlick.scala" class="shortcut">HelloSlick.scala</a> the <code>suppliers</code> is the <code>TableQuery</code> instance for the <ahref="#code/src/main/scala/Tables.scala" class="shortcut">Suppliers</a> class.<br/>
47
47
48
-
<ahref="http://slick.typesafe.com/doc/2.0.0/schemas.html" target="_blank">Learn more about mapping tables and columns in the Slick docs</a>.
48
+
<ahref="http://slick.typesafe.com/doc/2.1.0-M2/schemas.html" target="_blank">Learn more about mapping tables and columns in the Slick docs</a>.
49
49
</p>
50
50
</div>
51
51
@@ -62,7 +62,7 @@ <h2>Database Connection</h2>
62
62
63
63
It is also possible to create a session and manually close it. The <ahref="#code/src/test/scala/TablesSuite.scala" class="shortcut">TablesSuite.scala</a> tests do this in the <code>before</code> and <code>after</code> functions.
64
64
65
-
<ahref="http://slick.typesafe.com/doc/2.0.0/connection.html#session-handling" target="_blank">Learn more about session and connnection handling in the Slick docs</a>.
65
+
<ahref="http://slick.typesafe.com/doc/2.1.0-M2/connection.html#session-handling" target="_blank">Learn more about session and connnection handling in the Slick docs</a>.
66
66
</p>
67
67
</div>
68
68
@@ -87,7 +87,7 @@ <h2>Basic CRUD</h2>
87
87
</p>
88
88
89
89
<p>
90
-
Basic reads / queries can be done through the <code>TableQuery</code> instance using <ahref="http://slick.typesafe.com/doc/2.0.0/api/#scala.slick.jdbc.UnitInvoker" target="_blank">Invoker</a> functions. A simple example of invoking a query is to just call <code>list</code> on the <code>Query</code>, like:
90
+
Basic reads / queries can be done through the <code>TableQuery</code> instance using <ahref="http://slick.typesafe.com/doc/2.1.0-M2/api/#scala.slick.jdbc.UnitInvoker" target="_blank">Invoker</a> functions. A simple example of invoking a query is to just call <code>list</code> on the <code>Query</code>, like:
91
91
<pre><code>suppliers.list</code></pre>
92
92
That would produce a <code>List[(Int, String, String, String, String, String)]</code> that corresponds to the columns defined in the <code>Table</code> mapping. Other methods like <code>foreach</code>, <code>first</code>, <code>foldLeft</code> also perform queries. Filtering, sorting, and joining will be covered in the next few sections of the tutorial. In <ahref="#code/src/main/scala/HelloSlick.scala" class="shortcut">HelloSlick.scala</a> you can see how a <code>foreach</code> is used to do a <code>select *</code> query and then print each row.
93
93
</p>
@@ -225,7 +225,7 @@ <h2>Running Queries</h2>
225
225
<div>
226
226
<h2>Next Steps</h2>
227
227
228
-
<p>Check out the full <ahref="http://slick.typesafe.com/doc/2.0.1/" target="_blank">Slick manual and API docs</a>.</p>
228
+
<p>Check out the full <ahref="http://slick.typesafe.com/doc/2.1.0-M2/" target="_blank">Slick manual and API docs</a>.</p>
229
229
230
230
<p>You can also find more Slick templates, contributed by both, the Slick team and the community, <ahref="/home" class="shortcut">here in Activator</a>.</p>
0 commit comments