Releases: typelevel/doobie
v0.12.0
This release removes Scala 3.0.0-M2 and adds Scala 3.0.0-RC1.
Note that we refer below to changes since v0.10.0. The 0.11 series was never released.
Default java.time instances for PostgreSQL in doobie.postgres.implicits._
Confusion around which date time instances to use has been a constant issues to Doobie users, and in this release we aim to make this easier.
If you're using PostgreSQL, import doobie.postgres.implicits._
will now provide you with the correct Meta
instances for java.time
types, based on pgjdbc's native support for them. You should remove any doobie.implicits.javatime
or doobie.implicits.legacy
imports as they will likely cause ambiguous implicits error.
If you're using other databases, you can keep using the current instances that you explicitly import. You can also submit a PR with a similar setup as the postgres module to make everyone life easier :)
If you see deprecation warnings about import doobie.implicits.javatime._
, you can change it to import doobie.implicits.javatimedrivernative._
(Same behaviour and instances - just a better name for clarity)
Other changes:
- Library updates.
- Fix a crash in
IOAnalysisMatchers
(Dmitry Polienko) - Make Update#apply take logHandler implicitly (Eugene Platonov)
- Add Adopters list to documentation (Eugene Platonov)
- Add postgres java.time meta instances specifically for pgjdbc driver (Jacob Wang)
- Doc improvements (Jacob Wang, Saskia Gennrich)
- Make Query#executeQuery cancelable (Michael Tkachev)
- Expose fragment internals (Rob Norris)
v0.10.0
Scala 3
This is the first non-milestone release that supports Scala 3 (versions 3.0.0-M2 and 3.0.0-M3, as well as 2.12 and 2.13 as before).
Remainder is the same as release notes from 0.10.0-M2.
Differences between Scala 2 and Scala 3 versions
- The
postgres-circe
,quill
,scalatest
, andspecs2
modules are not yet available for Scala 3, pending releases of upstream dependencies. - Shapeless is not used in the Scala 3 version. Instances are derived via
Tuple
andProduct
rather thanHList
andGeneric
. Get
andPut
instances cannot be derived for unaryAnyVal
s in Scala 3. See scala/scala3#7023
Global Changes
Most end users should note:
- The
enum
package has been renamedenumerated
. For Scala 2 users anenum
object remains behind as a bridge. - Deprecated JDBC and Postgres Driver methods have been removed from the Free APIs.
Advanced users should note:
- doobie no longer relies on
TypeTag
, it usesTypeName
instead. - Line number macros have been internalized; there is no longer a dependency on
lihaoyi/sourcecode
.
Contributors should note:
- Tests have been migrated from specs2 to MUnit.
v0.10.0-M2
Scala 3
This release adds support for Scala 3.0.0-M2. It will remain a milestone version until all library dependencies are non-milestones.
Differences between Scala 2 and Scala 3 versions
- The
postgres-circe
,quill
,scalatest
, andspecs2
modules are not yet available for Scala 3, pending releases of upstream dependencies. - Shapeless is not used in the Scala 3 version. Instances are derived via
Tuple
andProduct
rather thanHList
andGeneric
. Get
andPut
instances cannot be derived for unaryAnyVal
s in Scala 3. See scala/scala3#7023
Global Changes
Most end users should note:
- The
enum
package has been renamedenumerated
. For Scala 2 users anenum
object remains behind as a bridge. - Deprecated JDBC and Postgres Driver methods have been removed from the Free APIs.
Advanced users should note:
- doobie no longer relies on
TypeTag
, it usesTypeName
instead. - Line number macros have been internalized; there is no longer a dependency on
lihaoyi/sourcecode
.
Contributors should note:
- Tests have been migrated from specs2 to MUnit.
v0.9.2
New Features
IN
query helper for tuples (fragments.in(..)
)
You can now generate IN
queries involving tuple of values.
val nameAgeCriteria: NonEmptyList[(String, Int)] = NonEmptyList.of("Alice" -> 30, "Bob" -> 25)
fr"SELECT id, name, age FROM person WHERE " ++ fragments.in(fr"(name, age)", nameAgeCriteria)
// Generates SQL "SELECT id, name, age FROM person WHERE (name, age) IN ((?, ?), (?, ?))"
v0.9.1 - Incomplete Release. Do Not Use
v0.9.0
New Features
Interpolate Fragment
values in fragment interpolator
You can now interpolate fragment inside fr
intepolators as a way to combine fragments (Previously you'd need to use ++
)
For example, you can now do this
val num = 1
val whereCondition: Fragment = fr"WHERE age = $num"
fr"SELECT name, age FROM person ${whereCondition} ORDER BY age"
Query#toMap
to construct a map
If you have a Query0[(K, V)]
, you can now call toMap
to construct a Map[K, V]
PR #1113 thanks to @keiSunagawa!
v0.8.8
This is a follow-up to 0.8.7 which caused some runtime failures due to a change in the way the java.time.Instant
mapping was defined. Mappings for temporal types now require an explicit import. This is a non-binary-compatible change, despite being a patch version. Sorry about that.
Defining Package | Import |
---|---|
java.sql |
import doobie.implicits.javasql._ |
java.time (JSR-310) |
import doobie.implicits.javatime._ |
Prior to v0.8.7 there were instances for Instant
and LocalDate
that were derived via the java.sql
types Timestamp
and Date
, respectively. These are now hidden, but if you want the old behavior you can import them. Note that Postgres requires these old instances!
Legacy Instance | Import |
---|---|
Instant |
import doobie.implicits.legacy.instant._ |
LocalDate |
import doobie.implicits.legacy.localdate._ |
Thanks to Andras Zsamboki for sorting this out.
Additional contributions:
- Quill logging now works with doobie. Logs go to a logger called
"DoobieContext"
which can be enabled as described in the Quill documentation. - There is a new trivial example in the
example/
module demonstrating a no-op interpreter.
v0.8.7
This release adds Meta/Get/Put
instance for the following JSR-310 data types, as specified by JDBC 4.2.
Instant
LocalDate
LocalTime
LocalDateTime
OffsetTime
OffsetDateTime
ZonedDateTime
As will all JDBC features, support will vary from vendor to vendor so be sure to write tests to make sure they're doing what you think! Many thanks to Andras Zsamboki for this contribution.
Additional thanks to Brian Wignall and Giuseppe Crinò for documentation improvements.