Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sake92 committed Jan 9, 2024
1 parent 1dc673f commit f83e946
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Additional support for Postgres, MySql, MariaDb, Oracle.


---
Scastie example: https://scastie.scala-lang.org/93LkJTTVRVad2jNv1KE4HA
Scastie example: https://scastie.scala-lang.org/JArud6GGSLOmYyxCNsNdNw


---
Expand Down
2 changes: 1 addition & 1 deletion docs/src/files/howtos/FullJoin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object FullJoin extends HowToPage {

Full example:
```scala
import ba.sake.squery.*
import ba.sake.squery.{*, given}

case class Customer(id: Int, name: String) derives SqlReadRow
case class Phone(id: Int, number: String) derives SqlReadRow
Expand Down
2 changes: 1 addition & 1 deletion docs/src/files/howtos/ReadMultiColRows.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object ReadMultiColRows extends HowToPage {
A natural fit for that are `case class`es.
We need to add a `derives SqlReadRow`, and then we can use it:
```scala
import ba.sake.squery.*
import ba.sake.squery.{*, given}

case class Customer(id: Int, name: String) derives SqlReadRow

Expand Down
2 changes: 1 addition & 1 deletion docs/src/files/howtos/ReadOneColRows.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object ReadOneColRows extends HowToPage {
s"""
We use the `readValues[T]()` to read single-column results:
```scala
import ba.sake.squery.*
import ba.sake.squery.{*, given}
def customersIds: List[Int] = ctx.run {
sql"SELECT id FROM customers".readValues[Int]()
Expand Down
2 changes: 1 addition & 1 deletion docs/src/files/tutorials/GettingStarted.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object GettingStarted extends TutorialPage {
You will probably want to use a connection pool for performance (like HikariCP).

```scala
import ba.sake.squery.*
import ba.sake.squery.{*, given}
// import one of these if needed:
// import ba.sake.squery.postgres.*
// import ba.sake.squery.mysql.*
Expand Down
2 changes: 1 addition & 1 deletion docs/src/files/tutorials/Index.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ object Index extends TutorialPage {
Section(
"Scastie",
s"""
You can also use this [Scastie example](https://scastie.scala-lang.org/93LkJTTVRVad2jNv1KE4HA) to try ${Consts.ProjectName} online.
You can also use this [Scastie example](${Consts.ScastieExampleUrl}) to try ${Consts.ProjectName} online.
""".md
),
Section(
Expand Down
2 changes: 2 additions & 0 deletions docs/src/utils/Consts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ object Consts:
val GhUrl = s"https://github.com/${GhHandle}/${GhProjectName}"
val GhSourcesUrl = s"${GhUrl}/tree/main"

val ScastieExampleUrl = "https://scastie.scala-lang.org/JArud6GGSLOmYyxCNsNdNw"

val tq = """""""""
4 changes: 2 additions & 2 deletions examples/cli/hello.sc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//> using scala "3.3.1"
//> using dep "ba.sake::squery:0.0.19"
//> using dep "ba.sake::squery:0.1.0"
//> using dep "com.h2database:h2:2.1.214"
//> using dep "com.lihaoyi::pprint:0.8.1"

import ba.sake.squery.*
import ba.sake.squery.{*, given}
import org.h2.jdbcx.JdbcDataSource

val ds = JdbcDataSource()
Expand Down

0 comments on commit f83e946

Please sign in to comment.