daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Jun 4th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     txn, err := db.DB().Begin()
  2.     if err != nil {
  3.         return err
  4.     }
  5.  
  6.     stmt, err := txn.Prepare(pq.CopyIn("column1", "column2", "column3", "columnN"))
  7.     if err != nil {
  8.         return err
  9.     }
  10.  
  11.     _, err = stmt.Exec(column1Value, column2Value, column3Value, columnNValue)
  12.  
  13.     if err != nil {
  14.         return err
  15.     }
  16.  
  17.     _, err = stmt.Exec()
  18.     if err != nil {
  19.         return err
  20.     }
  21.  
  22.     err = stmt.Close()
  23.     if err != nil {
  24.         return err
  25.     }
  26.  
  27.     err = txn.Commit()
  28.     if err != nil {
  29.         return err
  30.     }
  31.  
  32.     return err
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top