-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from slick/upgrade-scala-to-2-13-with--xsource…
…-3-and-add-scal Upgrade Scala to 2.13 with -Xsource:3 and add scalafmt
- Loading branch information
Showing
9 changed files
with
89 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version = 3.8.3 | ||
|
||
runner.dialect = Scala213Source3 | ||
align.preset = most |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 10 additions & 6 deletions
16
src/main/scala/PlainSQL.scala → ...la/slick/examples/plainsql/PlainSQL.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package slick.examples.plainsql | ||
import slick.jdbc.GetResult | ||
|
||
/** The Data Transfer Objects for the PlainSQL app */ | ||
trait Transfer { this: PlainSQL.type => | ||
|
||
// Case classes for our data | ||
case class Supplier( | ||
id: Int, | ||
name: String, | ||
street: String, | ||
city: String, | ||
state: String, | ||
zip: String | ||
) | ||
case class Coffee( | ||
name: String, | ||
supID: Int, | ||
price: Double, | ||
sales: Int, | ||
total: Int | ||
) | ||
|
||
// Result set getters | ||
implicit val getSupplierResult: GetResult[Supplier] = GetResult(r => | ||
Supplier( | ||
r.nextInt(), | ||
r.nextString(), | ||
r.nextString(), | ||
r.nextString(), | ||
r.nextString(), | ||
r.nextString() | ||
) | ||
) | ||
implicit val getCoffeeResult: GetResult[Coffee] = | ||
GetResult(r => Coffee(r.<<, r.<<, r.<<, r.<<, r.<<)) | ||
} |