-
Notifications
You must be signed in to change notification settings - Fork 841
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 query with enum array ? #1549
Comments
The issue isn't with your Go type t, err := conn.LoadType(context.Background(), "level") // level type
// check error
conn.TypeMap().RegisterType(t)
t, err = conn.LoadType(context.Background(), "_level") // array of level type
// check error
conn.TypeMap().RegisterType(t) |
thank you, jack. it works |
@jackc can i ask why this is only a problem with pgx? |
I do not know what other drivers may be doing, but if I had to guess I would say that they just assume that Go |
@jackc Thank you for the explanation! |
if i'm using |
nevermind, found docs for |
hello! when i use query with arry of enums, i get an error:
Query failed. err=failed to encode args[0]: unable to encode []main.Level{"low", "middle"} into text format for unknown type (OID 16408): cannot find encode plan
first, i create a table of author and level is enum type
then, i use query like this:
Could you tell me how can i use []Level type to query the ids?
The text was updated successfully, but these errors were encountered: