Golang database/sql.DB.Exec function example
package database/sql
Exec executes a query without returning any rows. The args are for any placeholder parameters in the query.
Golang database/sql.DB.Exec function usage example
db, err := sql.Open("mysql", dbURL)
if err != nil {
t.Fatalf("Error connecting: %s", err.Error())
}
defer db.Close()
db.Exec("DROP TABLE IF EXISTS dummy") // <-- here
Reference :
Advertisement
Something interesting
Tutorials
+6.5k Golang : Combine slices of complex numbers and operation example
+12.1k Golang : Decompress zlib file example
+8.8k Golang : Heap sort example
+11.6k Golang : Fuzzy string search or approximate string matching example
+10.8k Android Studio : Checkbox for user to select options example
+8.6k Golang : Progress bar with ∎ character
+18.8k Golang : Delete duplicate items from a slice/array
+7.9k Javascript : Put image into Chrome browser's console
+21.8k Golang : Convert string slice to struct and access with reflect example
+6.7k Golang : Output or print out JSON stream/encoded data
+10.6k Golang : Flip coin example
+5.4k Python : Delay with time.sleep() function example