-
Notifications
You must be signed in to change notification settings - Fork 0
Update doobieVersion to v1.0.0-RC10 #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
renovate
wants to merge
1
commit into
master
Choose a base branch
from
renovate/doobieversion
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
d32963b to
0851ca9
Compare
0851ca9 to
6398e94
Compare
c414794 to
1a83dab
Compare
7019b87 to
09ce415
Compare
09ce415 to
3c42507
Compare
c768f80 to
814afd4
Compare
359e42d to
509f272
Compare
93836ae to
4f16c61
Compare
7ab8669 to
a07716c
Compare
0217b9e to
44fef23
Compare
6f30048 to
605277b
Compare
cec7cc5 to
c987957
Compare
a19385a to
43e444f
Compare
f4e4316 to
e558489
Compare
e558489 to
0dd61b6
Compare
7413855 to
e46534d
Compare
237d445 to
1eebe8d
Compare
1eebe8d to
2db8b0b
Compare
2db8b0b to
78fa989
Compare
78fa989 to
bcad582
Compare
bcad582 to
f2a3ae9
Compare
f2a3ae9 to
9f46574
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
None yet
0 participants
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.0.0-RC2->1.0.0-RC101.0.0-RC2->1.0.0-RC101.0.0-RC2->1.0.0-RC101.0.0-RC2->1.0.0-RC101.0.0-RC2->1.0.0-RC10Release Notes
typelevel/doobie (org.tpolecat:doobie-core)
v1.0.0-RC10Compare Source
This release is a small release, with a minor change and some dependency updates.
Dependency updates
Also thanks to various other project internal improvements from @xuwei-k and @sharmaakshay177!
New Contributors
Full Changelog: typelevel/doobie@v1.0.0-RC9...v1.0.0-RC10
v1.0.0-RC9Compare Source
Fixes & Changes
class Derivedasfinalby @satorg in #2231Gets andPuts by @satorg in #2232Documentation
Dependency updates
Internal changes
usingclause by @xuwei-k in #2228New Contributors
Full Changelog: typelevel/doobie@v1.0.0-RC8...v1.0.0-RC9
v1.0.0-RC8Compare Source
This release contains some small improvements/bugfixes
New
Bug fixes
Documentation
Full Changelog: typelevel/doobie@v1.0.0-RC7...v1.0.0-RC8
v1.0.0-RC7Compare Source
Release notes below include all changes since 1.0.0-RC5.
Notable features / changes
Query Cancellation
Query cancellation has been implemented via calling
PreparedStatement#close()on fiber cancellation.Big thanks to @TalkingFoxMid and contributions from @satorg @armanbilge!
Related PRs: #2079 #2088
Opt-in automatic derivation
Automatic derivation has been the (non-configurable) default in Doobie since the start. While convenient, it can lead to long compile times because
Read/Write/Get/Putinstances are derived every time it is needed.We have significantly reworked the internals of Read/Write derivation to allow opt-in semi-auto and automatic derivation.
import doobie.implicits.*will enable automatic derivation (maintaining source compatibility to ease migration).import doobie.generic.auto.*to explicitly enable automatic derivation. Compared toimport doobie.implicits.*this brings just the implicits/givens necessary for automatic derivationimport doobie.implicits.*toimport doobie.syntax.all.*and gradually fix compile errors by deriving instances explicitly (see below):To derive instances explicitly:
Scala 3:
Scala 2+:
As part of this derivatino rework, it is now possible to obtain a
Read[Option[A]]/Write[Option[A]]instancedirectly from
Read[A]/Write[A].Related PRs:
Better type-checking with JDBC vendor types (For Postgres
java.time.*and enums)In previous releases, doobie typecheck only checks against the integer (enum) returned by
java.sql.ResultSetMetaData#getColumnType(java.sql.Types). However this is inadequate for two reasons:java.sql.Typesdoesn't cover many other possible database-specific types (e.g. JSON column type)java.sql.Typesfor legacy reasonsFor example, for a
TIMESTAMP WITH TIME ZONEcolumn Postgres JDBC driver will report that it has the typejava.sql.Types.TIMESTAMP(surprising asjava.sql.Types.TIMESTAMP_WITH_TIMEZONEexists).This means by just using the result from
getColumnTypetypechecking couldn't differentiate between aTIMESTAMP WITH TIME ZONEcolumn vsTIMESTAMP (WITHOUT TIMEZONE)column - which has serious implications for correctness of your program if one uses the wrong column type!Fortunately, we can see that
getColumnTypeNamedoes differentiate between the two column types.To help improve typechecking for
java.time.*types (and generally), we have made the following changes:1.
GetandPutcan now specify vendor column type nameWhen creating a
GetorPutinstance, the vendor type name can now be specified so typechecking will check against it.When constructing instances (e.g.
Get.Basic.one(..)) you can pass the expected vendor type tocheckedVendorTypeparameter, orNoneif you don't need or want to check against the vendor type.2. Move
java.time.*instances into database modulesjava.time.*instances are moved to their database-specific modules to handle differences in databases and their drivers.doobie.postgres.implicits.*doobie.mysql.implicits.*For other databases that support Java 8 time types, you can continue to use
import doobie.implicits.javatimedrivernative.*but there's no check against vendor type names.3. Make
doobie.implicits.javasqlinstances available by defaultdoobie.implicits.javasqlhas now been removed. You can safely remove anyimport doobie.implicits.javasql.*as these instances are now available without any import.4. Better typechecked array enum columns (Postgres-only)
If you have a column which is an array of enum type, you should switch to use
doobie.postgres.implicits.arrayOfEnumto define the
Metainstance on the application side for better typechecking.Related PRs:
Logging for streaming and updateMany queries
Query/Updatewhich now allow queries ran throughQuery#streamandUpdate#withGeneratedKeysto be logged. As part of this work,doobie.hi.FCmodule also have 3 new functions:stream,executeWithResultSetandexecuteWithoutResultSet. Old functions that does not log (such asdoobie.hi.FC.updateWithGeneratedKeys) has been deprecated and will be removed by 1.0.Related PRs:
Other changes
updateSetOptfragment (#1893) by @matsluni in #2126INandNOT INfragment builders for product types with arbitrary arities by @satorg in #2128Notable dependency updates
Internal/doc changes
New Contributors
Big thanks to all new and regular contributors!
Full Changelog: typelevel/doobie@v1.0.0-RC5...v1.0.0-RC7
v1.0.0-RC6: 1.0.0-RC6Compare Source
Warning: We have an issue in this release related to automatic derivation not using explicitly defined instances (See #2104). Please refrain from using this release and skip to 1.0.0-RC7 when it is out.
Query Cancellation
Query cancellation has been implemented via calling
PreparedStatement#close()on fiber cancellation.Big thanks to @TalkingFoxMid and contributions from @satorg @armanbilge @jatcwang!
Related PRs: #2079 #2088
Opt-in automatic derivation
Automatic derivation has been the (non-configurable) default in Doobie since the start. While convenient, it can lead to long compile times because
Read/Write/Get/Putinstances are derived every time it is needed.For those who want shorter compile times, we have now made automatic derivation opt in!
import doobie.implicits.*will enable automatic derivation (maintaining source compatibility to ease migration).import doobie.generic.auto.*to explicitly enable automatic derivation. Compared toimport doobie.implicits.*this brings just the implicits/givens necessary for automatic derivationimport doobie.implicits.*toimport doobie.syntax.all.*and gradually fix compile errors by deriving instances explicitly (see below):To derive instances explicitly:
Scala 3:
Scala 2+:
Related PRs:
Better type-checking with JDBC vendor types (For
java.time.*and more)In previous releases, doobie typecheck only checks against the int enum returned by
java.sql.ResultSetMetaData#getColumnType(java.sql.Types). However this is inadequate for two reasons:java.sql.Typesdoesn't cover many other possible database-specific types (e.g. JSON column type)java.sql.Types, often due to legacyFor example, for a
TIMESTAMP WITH TIME ZONEcolumn Postgres JDBC driver will report that it has the typejava.sql.Types.TIMESTAMP(surprising asjava.sql.Types.TIMESTAMP_WITH_TIMEZONEexists).This means by just using the result from
getColumnTypetypechecking couldn't differentiate between aTIMESTAMP WITH TIME ZONEcolumn vsTIMESTAMP (WITHOUT TIMEZONE)column - which has serious implications for correctness of your program if one uses the wrong column type!Fortunately, we can see that
getColumnTypeNamedoes differentiate between the two column types.To help improve typechecking for
java.time.*types (and generally), we have made the following changes:1.
GetandPutcan now specify vendor column type nameWhen creating a
GetorPutinstance, the vendor type name can now be specified so typechecking will check against it.When constructing instances (e.g.
Get.Basic.one(..)) you can pass the expected vendor type tocheckedVendorTypeparameter, orNoneif you don't need or want to check against the vendor type.2. Move
java.time.*instances into database modulesjava.time.*instances are moved to their database-specific modules to handle differences in databases and their drivers.doobie.postgres.implicits.*doobie.mysql.implicits.*For other databases that support Java 8 time types, you can continue to use
import doobie.implicits.javatimedrivernative.*but there's no check against vendor type names.3. Make
doobie.implicits.javasqlinstances available by defaultdoobie.implicits.javasqlhas now been removed. You can safely remove anyimport doobie.implicits.javasql.*as these instances are now available without any import.Related PRs:
Logging for streaming and updateMany queries
Query/Updatewhich now allow queries ran throughQuery#streamandUpdate#withGeneratedKeysto be logged. As part of this work,doobie.hi.FCmodule also have 3 new functions:stream,executeWithResultSetandexecuteWithoutResultSet. Old functions that does not log (such asdoobie.hi.FC.updateWithGeneratedKeys) has been deprecated and will be removed by 1.0.Related PRs:
Other notable changes
Dependency updates
Internal/doc changes
New Contributors
Full Changelog: typelevel/doobie@v1.0.0-RC5...v1.0.0-RC6
v1.0.0-RC5: 1.0.0-RC5Compare Source
What's New
WeakAsync.liftIOby @armanbilge in tpolecat#1910Bug fixes and improvements
syncStepinWeakAsync.liftKby @armanbilge in tpolecat#1906New Contributors
Full Changelog: typelevel/doobie@v1.0.0-RC4...v1.0.0-RC5
v1.0.0-RC4Compare Source
v1.0.0-RC3Compare Source
Java 11 & major dependency updates
Effectful Logging & Transactor-level logging
In previous versions Doobie supports SQL statement logging via LogHandler. However, it has the slightly awkward interface of
final case class LogHandler(unsafeRun: LogEvent => Unit)which makes it difficult to integrate with pure FP logging libraries.We have reworked how logging works, with the two major difference being:
def run(logEvent: LogEvent): M[Unit]Transactor[M]now has a singleLogHandler[M]attached to it, in order to align the effect type.To recover some of the previous functionality of per-query logging logic, you can call
.queryWithLabel/.updateWithLabel(instead of.query/.update) to attach aStringlabel to each query.This
labelwill be set for each LogEvent, which yourLogHandlercan then use to differentiate the queries being logged. (e.g. use it for metrics)For more advanced use case where you want to pass more structured contextual information for logging purposes, you can use
IOLocal(The docs on logging has an example)Big thanks to @oyvindberg for the implementation of effectful LogHandler and @george-wilson-rea for adding query labels
Basic migration steps
LogHandler[M]when constructing your Transactor (or pass a None if you don't want to log events)Tightening Postgres java.time instance typecheck
In #1735 / #1736, we tightened Meta instances for PostgreSQL java.time instances to reflect what the postgres-jdbc driver actually allows. For example, typechecking a query that tries to map a
java.time.OffsetDateTimeto aVARCHARcolumn in the database will now fail.Instance for ZonedDateTime has also been removed as it is misleading (PostgreSQL does not support a timestamp type that stores the timezone)
All PostgreSQL users should migrate to using
doobie.postgres.JavaTimeInstanceswhich has stricter type-checking to help you catch errors. For example, it enforces that the corresponding column type of anjava.time.Instantmust beTIMESTAMP WITH TIME ZONE.Thanks @guymers!
doobie-hikari: Now automatically creates the Connect ExecutionContext
doobie.hikari.HikariTransactor#fromConfig/fromHikariConfig previously requires you to pass in a
connectEC: ExecutionContextparameter used when awaiting a connection from the hikari connection pool.Since the general best practice is to set this fixed-size pool to your hikari connection pool size, we now automatically create this ExecutionContext for you based on
hikariConfig.getMaximumPoolSize.If you want to use your own
connectEClike previous versions, you can use doobie.hikari.HikariTransactor#fromConfigCustomEC/fromHikariConfigCustomEC instead.By @sideeffffect in #1690 and #1745
Improved composability and safety of fragment helpers (
doobie.util.fragments.*)and/or, we now wrap the resulting expression in parenthesis.This prevents scenarios where the boolean logic generated by
and/orcan be influenced by its surroundings due to the lack of parenthesisFor example, previously the code
fr"cond1 AND ${or(cond2, cond3)}"evaluates to the SQLcond1 AND cond2 OR cond3, which is most likely not equivalent to the user's intention ofcond1 AND (cond2 OR cond3)and will behave differently for certain cond1/2/3 values.Basic migration steps
andOpt/orOpt, which now return anOption[Fragment].and/or/andOpt/orOptif they are used in conjunction with other AND/OR. If you were previously relying on fragment helpers NOT wrapping the resulting expression in parenthesis, you should adjust your code to maintain to old behaviour**Other additions
Binary Compatibility
v1.0.0-RC3 is NOT binary compatible
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.