Skip to content

Commit

Permalink
Release v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nMoncho committed Jan 19, 2024
1 parent 51678c2 commit d559c5a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ avoid introducing a complex API.
Include the library into you project definition:

```scala
libraryDependencies += "net.nmoncho" %% "helenus-core" % "1.2.2"
libraryDependencies += "net.nmoncho" %% "helenus-core" % "1.3.0"
```

## Motivation
Expand Down Expand Up @@ -63,7 +63,7 @@ import net.nmoncho.helenus._

// Then mark your session implicit
implicit val session: CqlSession = getSession
// session: CqlSession = com.datastax.oss.driver.internal.core.session.DefaultSession@70f06a30
// session: CqlSession = com.datastax.oss.driver.internal.core.session.DefaultSession@79e52c8d

case class Address(street: String, city: String, stateOrProvince: String, postalCode: String, country: String)

Expand All @@ -75,7 +75,7 @@ implicit val typeCodec: TypeCodec[Address] = Codec.udtOf[Address]()

// We can derive how query results map to case classes
implicit val rowMapper: RowMapper[Hotel] = RowMapper[Hotel]
// rowMapper: RowMapper[Hotel] = net.nmoncho.helenus.internal.CaseClassRowMapperDerivation$$anonfun$net$nmoncho$helenus$internal$CaseClassRowMapperDerivation$$$nestedInanonfun$genericCCRowMapperBuilder$1$1@254f6c82
// rowMapper: RowMapper[Hotel] = net.nmoncho.helenus.internal.CaseClassRowMapperDerivation$$anonfun$net$nmoncho$helenus$internal$CaseClassRowMapperDerivation$$$nestedInanonfun$genericCCRowMapperBuilder$1$1@10ea9c4

val hotelId = "h1"
// hotelId: String = "h1"
Expand All @@ -84,7 +84,7 @@ val hotelId = "h1"
val hotelsById = "SELECT * FROM hotels WHERE id = ?".toCQL
.prepare[String]
.as[Hotel]
// hotelsById: internal.cql.ScalaPreparedStatement1[String, Hotel] = net.nmoncho.helenus.internal.cql.ScalaPreparedStatement1@71069351
// hotelsById: internal.cql.ScalaPreparedStatement1[String, Hotel] = net.nmoncho.helenus.internal.cql.ScalaPreparedStatement1@3040ded7

// We can extract a single result using `nextOption()`, or
// use `to(Coll)` to transform the result to a collection
Expand All @@ -107,7 +107,7 @@ hotelsById.execute("h1").nextOption()

// We can also run the same using CQL interpolated queries
val interpolatedHotelsById = cql"SELECT * FROM hotels WHERE id = $hotelId"
// interpolatedHotelsById: api.cql.WrappedBoundStatement[com.datastax.oss.driver.api.core.cql.Row] = net.nmoncho.helenus.api.cql.WrappedBoundStatement@2dccaaed
// interpolatedHotelsById: api.cql.WrappedBoundStatement[com.datastax.oss.driver.api.core.cql.Row] = net.nmoncho.helenus.api.cql.WrappedBoundStatement@5566abdb

interpolatedHotelsById.as[Hotel].execute().nextOption()
// res1: Option[Hotel] = Some(
Expand Down

0 comments on commit d559c5a

Please sign in to comment.