Skip to content

Releases: typelevel/doobie

v0.12.0

09 Mar 19:23
8dc67e8
Compare
Choose a tag to compare

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

05 Jan 20:06
Compare
Choose a tag to compare

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, and specs2 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 and Product rather than HList and Generic.
  • Get and Put instances cannot be derived for unary AnyVals in Scala 3. See scala/scala3#7023

Global Changes

Most end users should note:

  • The enum package has been renamed enumerated. For Scala 2 users an enum 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 uses TypeName 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

06 Dec 23:48
e24257f
Compare
Choose a tag to compare
v0.10.0-M2 Pre-release
Pre-release

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, and specs2 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 and Product rather than HList and Generic.
  • Get and Put instances cannot be derived for unary AnyVals in Scala 3. See scala/scala3#7023

Global Changes

Most end users should note:

  • The enum package has been renamed enumerated. For Scala 2 users an enum 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 uses TypeName 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

18 Sep 09:04
7be82d9
Compare
Choose a tag to compare

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 ((?, ?), (?, ?))"

PR #1255 thanks to @caoilte

v0.9.1 - Incomplete Release. Do Not Use

18 Sep 09:02
84d7bd3
Compare
Choose a tag to compare

v0.9.0

18 Sep 09:00
bec7d36
Compare
Choose a tag to compare

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" 

PR #1045 thanks to @neko-kai!

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

20 Dec 18:29
b54acb3
Compare
Choose a tag to compare

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

20 Dec 18:14
30a0397
Compare
Choose a tag to compare

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.

v0.8.6

13 Nov 20:37
136ff16
Compare
Choose a tag to compare

doobie-quill is now published for 2.13

v0.8.5

13 Nov 20:38
acfddf8
Compare
Choose a tag to compare

Fixed a bug that caused Quill queries to fail with a NullPointerException if the rightmost column yielded a NULL value.