diff options
author | Vlad Uspensky <v.uspenskiy@icloud.com> | 2018-05-03 10:32:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-03 10:32:06 -0700 |
commit | 6fde5b828ee0f131536d0df0caf68e712742de53 (patch) | |
tree | a988741af6c26dbc6de3d6a95fe417f0239c6938 /src/main/scala/xyz/driver/core | |
parent | 95dcc32a590ceb3b40371e2ef611a22afda5c499 (diff) | |
download | driver-core-1.9.0.tar.gz driver-core-1.9.0.tar.bz2 driver-core-1.9.0.zip |
Renaming `Dal` to `Repository` (#161)v1.9.0
* Renaming `Dal` to `Repository`
Diffstat (limited to 'src/main/scala/xyz/driver/core')
-rw-r--r-- | src/main/scala/xyz/driver/core/database/Repository.scala (renamed from src/main/scala/xyz/driver/core/database/Dal.scala) | 12 | ||||
-rw-r--r-- | src/main/scala/xyz/driver/core/database/package.scala | 9 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/main/scala/xyz/driver/core/database/Dal.scala b/src/main/scala/xyz/driver/core/database/Repository.scala index bcde0de..31c79ad 100644 --- a/src/main/scala/xyz/driver/core/database/Dal.scala +++ b/src/main/scala/xyz/driver/core/database/Repository.scala @@ -7,7 +7,7 @@ import slick.{lifted => sl} import scala.concurrent.{ExecutionContext, Future} -trait Dal { +trait Repository { type T[D] implicit def monadT: Monad[T] @@ -19,19 +19,19 @@ trait Dal { OptionT[T, R](customAction(action.run)) } -class FutureDal(executionContext: ExecutionContext) extends Dal { - implicit val exec = executionContext +class FutureRepository(executionContext: ExecutionContext) extends Repository { + implicit val exec: ExecutionContext = executionContext override type T[D] = Future[D] - implicit val monadT = implicitly[Monad[Future]] + implicit val monadT: Monad[Future] = implicitly[Monad[Future]] def execute[D](operations: T[D]): Future[D] = operations def noAction[V](v: V): T[V] = Future.successful(v) def customAction[R](action: => Future[R]): T[R] = action } -class SlickDal(database: Database, executionContext: ExecutionContext) extends Dal { +class SlickRepository(database: Database, executionContext: ExecutionContext) extends Repository { import database.profile.api._ - implicit val exec = executionContext + implicit val exec: ExecutionContext = executionContext override type T[D] = slick.dbio.DBIO[D] diff --git a/src/main/scala/xyz/driver/core/database/package.scala b/src/main/scala/xyz/driver/core/database/package.scala index 9385c8f..98fd5bd 100644 --- a/src/main/scala/xyz/driver/core/database/package.scala +++ b/src/main/scala/xyz/driver/core/database/package.scala @@ -36,4 +36,13 @@ package object database { cal.set(date.year, date.month, date.day, 0, 0, 0) new SqlDate(cal.getTime.getTime) } + + @deprecated("Dal is deprecated. Please use Repository trait instead!", "1.8.26") + type Dal = Repository + + @deprecated("SlickDal is deprecated. Please use SlickRepository class instead!", "1.8.26") + type SlickDal = SlickRepository + + @deprecated("FutureDal is deprecated. Please use FutureRepository class instead!", "1.8.26") + type FutureDal = FutureRepository } |