Skip to content

Commit dab42b8

Browse files
committed
version 0.5.4
1 parent 27e2c8b commit dab42b8

File tree

15 files changed

+56
-56
lines changed

15 files changed

+56
-56
lines changed

.travis.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
language: scala
2-
32
scala:
4-
- 2.10.4
5-
- 2.11.2
6-
3+
- 2.10.4
4+
- 2.11.4
5+
script: sbt clean coverage test
6+
after_success: sbt coveralls
77
addons:
8-
postgresql: "9.3"
9-
8+
postgresql: '9.3'
109
before_script:
11-
- psql -c "CREATE ROLE sa WITH SUPERUSER LOGIN PASSWORD 'sa';" -U postgres
12-
- psql -c "CREATE DATABASE scalikejdbc;" -U postgres
13-
- psql -c "CREATE DATABASE scalikejdbc2;" -U postgres
14-
- mysql -e 'GRANT ALL ON *.* TO sa@"localhost"IDENTIFIED BY "sa";FLUSH PRIVILEGES;' -uroot
15-
- mysql -e "CREATE DATABASE scalikejdbc;" -usa -psa
16-
10+
- psql -c "CREATE ROLE sa WITH SUPERUSER LOGIN PASSWORD 'sa';" -U postgres
11+
- psql -c "CREATE DATABASE scalikejdbc;" -U postgres
12+
- psql -c "CREATE DATABASE scalikejdbc2;" -U postgres
13+
- mysql -e 'GRANT ALL ON *.* TO sa@"localhost"IDENTIFIED BY "sa";FLUSH PRIVILEGES;'
14+
-uroot
15+
- mysql -e "CREATE DATABASE scalikejdbc;" -usa -psa
16+
env:
17+
global:
18+
secure: uD3eBk5OAXJPsTSLxJudTidbmxfDRiRuBm5snX/bTC4cA+22cjA8sWCi3+o5k/pwbofz3oi5CRouvm3xaaAlk9x9EDzR2PBh7m/sxyPRmWTl6NlLFQ24Xu6jUVCmwYoqvGsieJEouTXUwumL1OJxPQXjFUVLqS322hFzggYSE2U=

core/src/main/scala/scalikejdbc/async/FutureImplicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package scalikejdbc.async
22

3-
import scalikejdbc._, SQLInterpolation._
3+
import scalikejdbc._
44
import scala.concurrent._
55
import scalikejdbc.async.ShortenedNames._
66

core/src/main/scala/scalikejdbc/async/internal/NonSharedAsyncConnectionImpl.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ abstract class NonSharedAsyncConnectionImpl(
1717
extends AsyncConnectionCommonImpl
1818
with NonSharedAsyncConnection {
1919

20-
override def toNonSharedConnection()(implicit cxt: EC = ECGlobal): Future[NonSharedAsyncConnection] = {
21-
future(this)
22-
}
20+
override def toNonSharedConnection()(implicit cxt: EC = ECGlobal): Future[NonSharedAsyncConnection] = Future(this)
2321

2422
override def release(): Unit = pool.map(_.giveBack(this.underlying))
2523

core/src/main/scala/scalikejdbc/async/internal/SingleNonSharedAsyncConnectionImpl.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ abstract class SingleNonSharedAsyncConnectionImpl(val underlying: Connection)
2929
extends NonSharedAsyncConnection
3030
with AsyncConnectionCommonImpl {
3131

32-
override def toNonSharedConnection()(implicit cxt: EC = ECGlobal): Future[NonSharedAsyncConnection] = {
33-
future(this)
34-
}
32+
override def toNonSharedConnection()(implicit cxt: EC = ECGlobal): Future[NonSharedAsyncConnection] = Future(this)
3533

3634
override def release(): Unit = {}
3735

core/src/main/scala/scalikejdbc/async/internal/mysql/MySQLConnectionImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait MySQLConnectionImpl extends AsyncConnectionCommonImpl {
3030
val pool = this.asInstanceOf[PoolableAsyncConnection[Connection]].pool
3131
pool.take.map(conn => new NonSharedAsyncConnectionImpl(conn, Some(pool)) with MySQLConnectionImpl)
3232
} else {
33-
future(new SingleNonSharedAsyncConnectionImpl(underlying) with MySQLConnectionImpl)
33+
Future(new SingleNonSharedAsyncConnectionImpl(underlying) with MySQLConnectionImpl)
3434
}
3535
}
3636

core/src/main/scala/scalikejdbc/async/internal/postgresql/PostgreSQLConnectionImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait PostgreSQLConnectionImpl extends AsyncConnectionCommonImpl {
3030
val pool = this.asInstanceOf[PoolableAsyncConnection[Connection]].pool
3131
pool.take.map(conn => new NonSharedAsyncConnectionImpl(conn, Some(pool)) with PostgreSQLConnectionImpl)
3232
} else {
33-
future(new SingleNonSharedAsyncConnectionImpl(underlying) with PostgreSQLConnectionImpl)
33+
Future(new SingleNonSharedAsyncConnectionImpl(underlying) with PostgreSQLConnectionImpl)
3434
}
3535
}
3636

core/src/main/scala/scalikejdbc/async/package.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package scalikejdbc
22

3-
import scalikejdbc._, SQLInterpolation._
3+
import scalikejdbc._
44
import scala.concurrent.{ ExecutionContext, Future }
55
import scalikejdbc.async.ShortenedNames._
66
/**
77
* Default package to import
88
*
99
* {{{
10-
* import scalikejdbc._, async._, SQLInterpolation._
10+
* import scalikejdbc._, async._
1111
* }}}
1212
*/
1313
package object async {
@@ -131,4 +131,4 @@ package object async {
131131
}
132132
}
133133

134-
}
134+
}

core/src/test/scala/programmerlist/ExampleSpec.scala

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,14 @@ class ExampleSpec extends FlatSpec with Matchers with DBSettings with Logging {
3838
val withinTx: Future[Unit] = AsyncDB.localTx { implicit tx =>
3939
for {
4040
programmers <- Programmer.findAllBy(sqls.eq(p.companyId, newCompany.id))
41-
restructuring <- programmers.foldLeft(Future.successful()) {
42-
(prev, programmer) =>
43-
for {
44-
_ <- prev
45-
_ <- programmer.destroy()
46-
} yield ()
41+
restructuring <- programmers.foldLeft(Future.successful()) { (prev, programmer) =>
42+
for {
43+
_ <- prev
44+
res <- programmer.destroy()
45+
} yield ()
4746
}
4847
dissolution <- newCompany.destroy()
49-
_ <- sql"Just joking!".update.future
48+
f <- sql"Just joking!".update.future
5049
} yield ()
5150
}
5251
try Await.result(withinTx, 5.seconds)

play-sample/app/models/Company.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package models
22

3-
import scalikejdbc._, async._, FutureImplicits._, SQLInterpolation._
3+
import scalikejdbc._, async._, FutureImplicits._
44
import scala.concurrent._
55
import org.joda.time.DateTime
66

@@ -29,7 +29,7 @@ object Company extends SQLSyntaxSupport[Company] with ShortenedNames {
2929
)
3030

3131
lazy val c = Company.syntax("c")
32-
private val isNotDeleted = sqls.isNull(c.deletedAt)
32+
private lazy val isNotDeleted = sqls.isNull(c.deletedAt)
3333

3434
def find(id: Long)(implicit session: AsyncDBSession = AsyncDB.sharedSession, cxt: EC = ECGlobal): Future[Option[Company]] = withSQL {
3535
select.from(Company as c).where.eq(c.id, id).and.append(isNotDeleted)

play-sample/app/models/Programmer.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package models
22

3-
import scalikejdbc._, async._, SQLInterpolation._, FutureImplicits._
3+
import scalikejdbc._, async._, FutureImplicits._
44
import org.joda.time.DateTime
55
import scala.concurrent._
66

@@ -56,10 +56,10 @@ object Programmer extends SQLSyntaxSupport[Programmer] with ShortenedNames {
5656
// SyntaxProvider objects
5757
lazy val p = Programmer.syntax("p")
5858

59-
private val (c, s, ps) = (Company.c, Skill.s, ProgrammerSkill.ps)
59+
private lazy val (c, s, ps) = (Company.c, Skill.s, ProgrammerSkill.ps)
6060

6161
// reusable part of SQL
62-
private val isNotDeleted = sqls.isNull(p.deletedAt)
62+
private lazy val isNotDeleted = sqls.isNull(p.deletedAt)
6363

6464
// find by primary key
6565
def find(id: Long)(implicit session: AsyncDBSession = AsyncDB.sharedSession, cxt: EC = ECGlobal): Future[Option[Programmer]] = {

0 commit comments

Comments
 (0)