Skip to content

Commit 580c7bc

Browse files
committed
Add imports to more manual pages
1 parent 0e994ad commit 580c7bc

File tree

8 files changed

+40
-1
lines changed

8 files changed

+40
-1
lines changed

doc/code/CodeGenerator.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package com.typesafe.slick.docs
22

3+
//#imports
34
import scala.concurrent.ExecutionContext.Implicits.global
45
import slick.jdbc.H2Profile.api._
56
import slick.jdbc.H2Profile
7+
//#imports
68

79
object CodeGenerator extends App {
810
val uri = "#slick.db.default"

doc/code/Connection.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.typesafe.slick.docs
22

3+
//#imports
34
import java.sql.Blob
45
import javax.sql.rowset.serial.SerialBlob
56

@@ -13,6 +14,7 @@ import scala.language.higherKinds
1314
import scala.util.{Failure, Success}
1415
import slick.basic.DatabasePublisher
1516
import slick.jdbc.H2Profile.api._
17+
//#imports
1618

1719
object Connection extends App {
1820
class Coffees(tag: Tag) extends Table[(String, Blob)](tag, "COFFEES") {

doc/code/LiftedEmbedding.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package com.typesafe.slick.docs
22

3+
//#imports
34
import scala.concurrent.{Future, Await}
45
import scala.concurrent.duration.Duration
56
import slick.jdbc.H2Profile.api._
67
import java.sql.Date
78
import scala.reflect.ClassTag
9+
//#imports
810

911
object LiftedEmbedding extends App {
1012
// Simple Coffees for Rep types comparison

doc/src/code-generation.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ For Maven projects add the following to your `<dependencies>`:
3535
</dependency>
3636
```
3737

38+
> {.note}
39+
> In the code examples below we assume the following imports:
40+
>```scala src=../code/CodeGenerator.scala#imports
41+
> ```
42+
> If you're new to Slick, please start with the [Getting Started](gettingstarted.md) page.
43+
44+
3845
Slick's code generator comes with a default runner that can be used from the command line or from Java/Scala. You can simply execute
3946
4047
```scala src=../code/CodeGenerator.scala#default-runner-uri

doc/src/dbio.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ In most cases you will want to use the type aliases [DBIO](api:slick.dbio.packag
1515
and [StreamingDBIO](api:slick.dbio.package@StreamingDBIO[+R,+T]:StreamingDBIO[R,T]) for non-streaming and
1616
streaming Database I/O Actions. They omit the optional *effect types* supported by <api:slick.dbio.DBIOAction>.
1717

18+
> {.note}
19+
> In the code examples below we assume the following imports:
20+
>```scala src=../code/Connection.scala#imports
21+
> ```
22+
> If you're new to Slick, please start with the [Getting Started](gettingstarted.md) page.
23+
1824
Executing Database I/O Actions {index="execute,Action;Action,execute"}
1925
------------------------------
2026

doc/src/queries.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ Queries {index="lifted; Query"}
22
=======
33

44
This chapter describes how to write type-safe queries for selecting, inserting, updating and
5-
deleting data with Slick's Scala-based query API. The API for building queries is a
5+
deleting data with Slick's Scala-based query API.
6+
7+
> {.note}
8+
> In the code examples below we assume the following imports:
9+
>```scala src=../code/LiftedEmbedding.scala#imports
10+
> ```
11+
> If you're new to Slick, please start with the [Getting Started](gettingstarted.md) page.
12+
13+
The API for building queries is a
614
*lifted embedding*, which means that you are not working with standard Scala types but with types
715
that are *lifted* into a <api:slick.lifted.Rep> type constructor. This becomes clearer when you
816
compare the types of a simple Scala collections example

doc/src/schemas.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ them manually, which is useful when you start writing an application without a p
66
If you already have a schema in the database, you can also use the [code generator](code-generation.md)
77
to take this work off your hands.
88

9+
> {.note}
10+
> In the code examples below we assume the following imports:
11+
>```scala src=../code/LiftedEmbedding.scala#imports
12+
> ```
13+
> If you're new to Slick, please start with the [Getting Started](gettingstarted.md) page.
14+
915
Table Rows {index="table; row; ColumnOption; primary key; default; type; AutoInc; generated; identity; *; star projection; schema,name; name,schema"}
1016
----------
1117

doc/src/userdefined.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ User-Defined Features {index="user-defined"}
44
This chapter describes how to use custom data types and database functions
55
with Slick's Scala API.
66

7+
> {.note}
8+
> In the code examples below we assume the following imports:
9+
>```scala src=../code/LiftedEmbedding.scala#imports
10+
> ```
11+
> If you're new to Slick, please start with the [Getting Started](gettingstarted.md) page.
12+
713
Scalar Database Functions {index="scalar,function,user-defined; function,scalar,user-defined"}
814
-------------------------
915

0 commit comments

Comments
 (0)