-
Notifications
You must be signed in to change notification settings - Fork 43
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
Conversation
cloudflare/d1/stmt.go
Outdated
@@ -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}) |
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.
nits
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}) |
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.
fixed.
cloudflare/d1/stmt.go
Outdated
columns: nil, | ||
rowsObj: rowsObj, | ||
}, nil | ||
} else { |
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.
nits: Since the if
block returns early, there is no need for a corresponding else block. I want to keep the block nesting shallow.
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.
thanks.
fixed.
@zztkm Thanks! I posted some trivial comments, please check them out. |
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.
LGTM
What
close: #106
Motivation