Do you mean a SQL prepared statement? Check out the database/sql package. The database connection abstraction has a Prepare function which creates a statement. Keep in mind, that based on your level of concurrency, the statement will be re-prepared in each new connection that's opened up on your behalf. So, what you need to do is keep a persistent instance of sql.DB, which will try to maintain your prepared statements for you.
On Sat, Apr 13, 2019 at 10:58 AM <shrinath...@gmail.com> wrote: > Hi Team , > I am new in go lang ,I want to know is there any recommended way in go > lang to create prepare statement in go lang on application start and pass > it to multiple http handler so that query can be done inside those http > handlers. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.