File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
core/js/src/main/scala/porcupine Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,12 @@ private abstract class DatabasePlatform:
5252 def cursor (args : A ): Resource [F , Cursor [F , B ]] = mutex.lock *>
5353 Resource
5454 .eval {
55- F .delay(statement.iterate(bind(args)* )).map { iterator =>
55+ val argsList = bind(args)
56+ val argsDict : js.Dictionary [Any ] =
57+ js.Dictionary (argsList.zipWithIndex.map { case (v, idx) =>
58+ (s " ${idx + 1 }" , v)
59+ }* )
60+ F .delay(statement.iterate(argsDict)).map { iterator =>
5661 new :
5762 def fetch (maxRows : Int ): F [(List [B ], Boolean )] =
5863 F .delay {
@@ -90,7 +95,12 @@ private abstract class DatabasePlatform:
9095 new AbstractStatement [F , A , B ]:
9196 def cursor (args : A ): Resource [F , Cursor [F , B ]] =
9297 mutex.lock *> Resource .eval {
93- F .delay(statement.run(bind(args)* )).as(_ => F .pure(Nil , false ))
98+ val argsList = bind(args)
99+ val argsDict : js.Dictionary [Any ] =
100+ js.Dictionary (argsList.zipWithIndex.map { case (v, idx) =>
101+ (s " ${idx + 1 }" , v)
102+ }* )
103+ F .delay(statement.run(argsDict)).as(_ => F .pure(Nil , false ))
94104 }
95105
96106 }
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ private[porcupine] trait Statement extends js.Object:
3737
3838 def raw (toggleState : Boolean ): Statement = js.native
3939
40- def iterate (bindParameters : Any * ): js.Iterator [js.UndefOr [js.Array [Any ]]] = js.native
40+ def iterate (bindParameters : js.Dictionary [Any ]): js.Iterator [js.UndefOr [js.Array [Any ]]] =
41+ js.native
4142
42- def run (bindParameters : Any * ): js.Object = js.native
43+ def run (bindParameters : js. Dictionary [ Any ] ): js.Object = js.native
You can’t perform that action at this time.
0 commit comments