I am confused about how I can create a prepared statement. The lack of information in documentation a bit of dig into the code looks it is not possible.
Something like:
func initalization(c *gocql.Session) {
getUserStm = c.Prepare("select * from user wher id = ?")
}
func GetUser(c *gocql.Session, id string) .. {
return c.Exec(getUserStm.bind("id"))...
}
How can I create all the prepared statements during app initialization, then just bind variables when I need to call it? It is possible?
I am aware there are some adhoc "cache", but this doesn't tackle the issue of invalid queries are only detected during execution after the approval of the release. For now, the only solution I find is to smoke test all my queries before switch traffic. That is very code intensive and not always possible.