-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
How to call a function with array params #118
Comments
With pg.v4 you can try something like:
But array of time |
Overall array support is very limited right now - https://github.com/go-pg/pg/blob/v4/types/array.go#L16-L28 |
Actually the example needs curly brackets rather than round brackets:
Otherwise you get:
|
Eventually I will make it work correctly, but first I want to stabilize v4 branch and release ORM to public... |
FYI #138 added support for
There is still some work to be done, but it should be usable. |
I consider array support finished. See https://godoc.org/gopkg.in/pg.v4#example-DB-Model-PostgresqlArrayStructTag and https://godoc.org/gopkg.in/pg.v4#example-Array for examples. |
I have a function for batch insert, which has array parameters like so:
insert_batch(_dates date[], _values integer[])
I am trying to call it like the following:
SELECT * FROM insert_batch($1, $2)
I read through the souce code however I couldn't find a way I can do this. Is it possible to call raw select sql with bind parameters.
The text was updated successfully, but these errors were encountered: