Conversation
Author
|
The latest commit addresses point 1, with the |
Author
|
JS support blocked by WiseLibs/better-sqlite3#1032 |
creates a binding dictionary explicitly on JS, zipping the arguments with their index and binding str(idx+1) to the argument
armanbilge
reviewed
Oct 17, 2024
Comment on lines
+55
to
+60
| val argsList = bind(args) | ||
| val argsDict: js.Dictionary[Any] = | ||
| js.Dictionary(argsList.zipWithIndex.map { case (v, idx) => | ||
| (s"${idx + 1}", v) | ||
| }*) | ||
| F.delay(statement.iterate(argsDict)).map { iterator => |
Owner
There was a problem hiding this comment.
Let's put this all in the delay block, and I think we can build the JS object more efficiently without all the intermediate datastructures form zipWithIndex and map. Instead, we can just create a new js.Object and set its keys with js.Dynamic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The way this is implemented is via a
parameters: IntonEncoder.Notes:
State[Int, String]solution from Skunk was attempted, but there was no way to prevent the bad behavior of(someNonUnit, Codec.unit).tupledfrom generating(?, ?, ?,)rather than(?, ?, ?). A possible solution to this issue isState[Int, List[Either[String, Int]]], where the transitionsLeft→Left,Left→Right,Right→Leftare directly concatenated, but transitionsRight→Rightare joined with,.${ a *: b *: nil }, and I don't know why.Encoder#eitherin this case.def parameters = 16 times.