-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
database/sql: support output parameters #18079
Comments
The Oracle driver has support for output parameters but can't expose it in the sql package at this time: |
CL https://golang.org/cl/38533 mentions this issue. |
@mattn @jackc @tgulacsi @mjibson @cbandy @julienschmidt @methane Feedback requested for https://golang.org/cl/38533 . I need assistance in determining the correct API for OUTPUT parameters with regards to INOUT parameters. Currently I specify an argument is for an OUTPUT parameter by passing a pointer value inside of
This works because this is part of a larger CL that allows drivers to accept additional parameter types. Right now for MS SQL Server POC I'm sending the value to the server for both OUTPUT and INOUT situations and setting the fByRefValue flag on it. This works for MS SQL Server. Do we need to differentiate between OUTPUT and INOUT parameters for Oracle, Posgresql, or MySQL? For instance, should we have an |
I don't think it will matter for PostgreSQL. It does not have true stored procedures, it has functions. And the idiomatic way of calling them is with So for PG I think it would remain idiomatic to use |
Technically, for Postgres it would be better to do "SELECT * FROM myfunc(...)". I know there's some changes around calling an SRF in the SELECT clause coming in 10, though I don't recall the details. |
It may be possible to add support output parameters. Look into the benefit and cost of doing so.
The text was updated successfully, but these errors were encountered: