Skip to content

Commit

Permalink
Add LimboStepResult.java constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
seonWKim committed Jan 19, 2025
1 parent e92a520 commit 8d2e39a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bindings/java/rs_src/limbo_statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,12 @@ fn to_limbo_step_result<'local>(
"(I[Ljava/lang/Object;)V",
&ctor_args,
)
.unwrap_or_else(|_| JObject::null())
} else {
env.new_object(
"org/github/tursodatabase/core/LimboStepResult",
"(I[Ljava/lang/Object;)V",
"(I)V",
&ctor_args,
)
.unwrap_or_else(|_| JObject::null())
}
.unwrap_or_else(|_| JObject::null())
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Arrays;

import org.github.tursodatabase.annotations.NativeInvocation;
import org.github.tursodatabase.annotations.Nullable;

/**
* Represents the step result of limbo's statement's step function.
Expand All @@ -17,8 +18,15 @@ public class LimboStepResult {

// Identifier for limbo's StepResult
private final int stepResultId;
@Nullable
private final Object[] result;

@NativeInvocation(invokedFrom = "limbo_statement.rs")
public LimboStepResult(int stepResultId) {
this.stepResultId = stepResultId;
this.result = null;
}

@NativeInvocation(invokedFrom = "limbo_statement.rs")
public LimboStepResult(int stepResultId, Object[] result) {
this.stepResultId = stepResultId;
Expand Down

0 comments on commit 8d2e39a

Please sign in to comment.