Golang database/sql.Tx.Query function examples
package database/sql
Query executes a query that returns rows, typically a SELECT.
Golang database/sql.Tx.Query function usage examples
Example 1:
rows, err := txn.Query("CREATE TEMP TABLE foo(f1 int)")
if err != nil {
t.Fatal(err)
}
Example 2:
var nick string
row, err := tx.Query(`select score from plusplus where nick = ?`, strings.ToLower(nick))
if err != nil {
fmt.Printf("Database error: %v\n", err)
return
}
Reference :
Advertisement
Something interesting
Tutorials
+5.3k Golang : Generate Interleaved 2 inch by 5 inch barcode
+16.3k Golang : Loop each day of the current month example
+7.9k Javascript : How to check a browser's Do Not Track status?
+7.6k Javascript : Push notifications to browser with Push.js
+28k Golang : Move file to another directory
+6k Golang : Experimenting with the Rejang script
+5.4k Python : Delay with time.sleep() function example
+17.9k Golang : Qt image viewer example
+14.6k Golang : Send email with attachment(RFC2822) using Gmail API example
+5.3k Javascript : Change page title to get viewer attention
+8k Golang : Get all countries phone codes
+6.9k Golang : Decode XML data from RSS feed