-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ext/node): implement StatementSync#iterate #28168
Conversation
scope: &mut v8::HandleScope<'a>, | ||
#[varargs] params: Option<&v8::FunctionCallbackArguments>, | ||
) -> Result<v8::Local<'a, v8::Object>, SqliteError> { | ||
macro_rules! v8_static_strings { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just export this from deno_core
- this is the third place we're redefining this macro
tests/unit_node/sqlite_test.ts
Outdated
for (const row of stmt.iterate()) { | ||
result.push(row); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't it crash/error if you try to iterate again? Can you add a test for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test
Deno.test("[node/sqlite] StatementSync#iterate", () => { | ||
const db = new DatabaseSync(":memory:"); | ||
const stmt = db.prepare("SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3"); | ||
// @ts-ignore: types are not up to date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did y'all forget to eventually add these in? 😅
I'm able to call stmt.iterate() in Deno 2.2.3, but the types are not present so deno check
fails.
Fixes #28130