File tree 3 files changed +16
-2
lines changed
main/scala/scalikejdbc/async/internal
3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,13 @@ private[scalikejdbc] class AsyncResultSetImpl(rows: IndexedSeq[RowData])
38
38
39
39
// WrappedResultSet API
40
40
41
- override def any (columnIndex : Int ): Any = currentRow.map(_.apply(columnIndex)).orNull[Any ]
41
+ override def any (columnIndex : Int ): Any = {
42
+ // To be compatible with JDBC, index should be 1-origin
43
+ // But postgresql-async/mysql-async is 0-origin
44
+ val index0origin = columnIndex - 1
45
+ currentRow.map(_.apply(index0origin)).orNull[Any ]
46
+ }
47
+
42
48
override def any (columnLabel : String ): Any = currentRow.map(_.apply(columnLabel)).orNull[Any ]
43
49
44
50
override def bigDecimal (columnIndex : Int ): java.math.BigDecimal = any(columnIndex) match {
Original file line number Diff line number Diff line change @@ -13,6 +13,14 @@ class PostgreSQLSampleSpec extends FlatSpec with ShouldMatchers with DBSettings
13
13
val createdTime = DateTime .now.withMillisOfSecond(0 )
14
14
val al = AsyncLover .syntax(" al" )
15
15
16
+ it should " count" in {
17
+ val countFuture : Future [Long ] = AsyncDB .withPool { implicit s =>
18
+ withSQL { select(sqls.count).from(AsyncLover as al ) }.map(_.long(1 )).single.future().map(_.get)
19
+ }
20
+ val c = Await .result(countFuture, 5 .seconds)
21
+ c should be > 0L
22
+ }
23
+
16
24
it should " select a single value" in {
17
25
val resultFuture : Future [Option [AsyncLover ]] = AsyncDB .withPool { implicit s =>
18
26
withSQL { select.from(AsyncLover as al ).where.eq(al.id, 1 ) }.map(AsyncLover (al)).single.future()
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import play.Project._
4
4
5
5
object ScalikeJDBCAsyncProject extends Build {
6
6
7
- lazy val _version = " 0.3.2 "
7
+ lazy val _version = " 0.3.3 "
8
8
lazy val scalikejdbcVersion = " 1.7.0"
9
9
lazy val mauricioVersion = " 0.2.8"
10
10
lazy val defaultPlayVersion = " 2.2.1"
You can’t perform that action at this time.
0 commit comments