Skip to content
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 D1 driver implementation using stmt.raw({ columnNames: true }) #112

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

zztkm
Copy link
Contributor

@zztkm zztkm commented Apr 24, 2024

What

close: #106

Motivation

@@ -59,15 +59,30 @@ func (s *stmt) QueryContext(_ context.Context, args []driver.NamedValue) (driver
for i, arg := range args {
argValues[i] = arg.Value
}
resultPromise := s.stmtObj.Call("bind", argValues...).Call("all")
resultPromise := s.stmtObj.Call("bind", argValues...).Call("raw", map[string]interface{}{"columnNames": true})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

Suggested change
resultPromise := s.stmtObj.Call("bind", argValues...).Call("raw", map[string]interface{}{"columnNames": true})
resultPromise := s.stmtObj.Call("bind", argValues...).Call("raw", map[string]any{"columnNames": true})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

columns: nil,
rowsObj: rowsObj,
}, nil
} else {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: Since the if block returns early, there is no need for a corresponding else block. I want to keep the block nesting shallow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks.
fixed.

@syumai
Copy link
Owner

syumai commented Apr 24, 2024

@zztkm Thanks! I posted some trivial comments, please check them out.

Copy link
Owner

@syumai syumai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@syumai syumai merged commit 617355c into syumai:main Apr 24, 2024
2 checks passed
@zztkm zztkm deleted the fix#106 branch April 25, 2024 02:21
@syumai
Copy link
Owner

syumai commented Apr 27, 2024

@zztkm This fix has been released as v0.26.0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix D1 driver implementation using stmt.raw({ columnNames: true })
2 participants