Handle deallocate statements within the server statement cache #54
Replies: 3 comments
-
Hi @kishaningithub, the extended query protocol allows for a query to be reused with different parameters. The SQL is send using the parse command to which the server responds with a set of parameters which could be defined. The parsed SQL query could be executed during a execute command using the provided parameters. The simple query implementation allows you to simply send a single query and it's parameters in one command and execute it on the given server. I am not sure if this answers your question. Feel free to let me know if you wanted to dive into some other specific components. |
Beta Was this translation helpful? Give feedback.
-
To handle the above, in the SimpleQueryFn as of now i am doing the following if strings.Contains(query, "deallocate") {
return;
} Not sure if this is the way you intended. Do suggest better ways :-) |
Beta Was this translation helpful? Give feedback.
-
@kishaningithub I have been thinking a bit about this issue. I would like to close this issue for now since this is a PSQL language feature. The SimpleQuery handler should handle the incoming query since the PSQL server is not aware of language specific features. I am converting this issue into a discussion to keep the thread visible in case we would like to open it again in the future. |
Beta Was this translation helpful? Give feedback.
-
As of now when i run the following query using prepared statment of
database/sql
usingpgx
library the first request coming into the handler contains the query then the subsequent one containspsql-wire@v0.4.0/command.go:216 incoming simple query {"query": "deallocate \"pgx_0\""}
During prepared statment calls can just the sql alone be sent?
Beta Was this translation helpful? Give feedback.
All reactions