Skip to content

Commit 5a1fdb0

Browse files
committed
v0.2.0
1 parent 9d0494b commit 5a1fdb0

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ RDB as cache storage
55
## Install
66

77
```scala
8-
libraryDependencies += "com.github.tototoshi" %% "dbcache-mysql" % "0.1.1"
8+
libraryDependencies += "com.github.tototoshi" %% "dbcache-mysql" % "0.2.0"
99

1010
// or
11-
// libraryDependencies += "com.github.tototoshi" %% "dbcache-postgresql" % "0.1.1"
11+
// libraryDependencies += "com.github.tototoshi" %% "dbcache-postgresql" % "0.2.0"
1212
```
1313

1414
## Setup
@@ -119,7 +119,10 @@ class DBCacheApi(myCache: DBCache) extends CacheApi {
119119
def remove(key: String) = myCache.remove(key)
120120
}
121121

122-
class MySQLCacheApiProvider @Inject() (connectionPool: ConnectionPool) extends Provider[CacheApi] {
122+
class MySQLCacheApiProvider @Inject() (
123+
environment: Environment,
124+
connectionPool: ConnectionPool
125+
) extends Provider[CacheApi] {
123126
// Set up ConnectionFactory with your favorite database library
124127
val connectionFactory = new ConnectionFactory {
125128
override def get(): Connection = {
@@ -129,7 +132,7 @@ class MySQLCacheApiProvider @Inject() (connectionPool: ConnectionPool) extends P
129132
}
130133
}
131134
override def get(): CacheApi = {
132-
val mysqlCache = new MySQLCache(connectionFactory)
135+
val mysqlCache = new MySQLCache(connectionFactory, environment.classLoader)
133136
new DBCacheApi(mysqlCache)
134137
}
135138
}

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ lazy val core = (project in file("core"))
2222
.settings(
2323
name := "dbcache-core",
2424
organization := "com.github.tototoshi",
25-
version := "0.2.0-SNAPSHOT",
25+
version := "0.2.0",
2626
scalaVersion := "2.11.8",
2727
libraryDependencies ++= testDependencies
2828
).settings(Publish.settings)
@@ -31,7 +31,7 @@ lazy val mysql = (project in file("mysql"))
3131
.settings(
3232
name := "dbcache-mysql",
3333
organization := "com.github.tototoshi",
34-
version := "0.2.0-SNAPSHOT",
34+
version := "0.2.0",
3535
scalaVersion := "2.11.8",
3636
libraryDependencies ++= testDependencies ++ Seq(
3737
mysqlDependency % "provided"
@@ -42,7 +42,7 @@ lazy val postgresql = (project in file("postgresql"))
4242
.settings(
4343
name := "dbcache-postgresql",
4444
organization := "com.github.tototoshi",
45-
version := "0.2.0-SNAPSHOT",
45+
version := "0.2.0",
4646
scalaVersion := "2.11.8",
4747
libraryDependencies ++= testDependencies ++ Seq(
4848
postgresqlDependency % "provided"

0 commit comments

Comments
 (0)