Documentation ¶
Overview ¶
Package mydb mydb struct
Example ¶
package main import ( "database/sql" "log" _ "github.com/rongfengliang/mysqldriver" ) func main() { db, err := sql.Open("mydb", "mydb://dalong@127.0.0.1/demoapp") if err != nil { log.Fatalf("some error %s", err.Error()) } rows, err := db.Query("select * from demoapp") if err != nil { log.Println("some wrong for query", err.Error()) } for rows.Next() { rows.Scan() } }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MyRowS ¶
type MyRowS struct {
Size int64
}
MyRowS myRowS implemmet for driver.Rows
func (*MyRowS) Columns ¶
Columns returns the names of the columns. The number of columns of the result is inferred from the length of the slice. If a particular column name isn't known, an empty string should be returned for that entry.
func (*MyRowS) Next ¶
Next is called to populate the next row of data into the provided slice. The provided slice will be the same size as the Columns() are wide.
Next should return io.EOF when there are no more rows.
The dest should not be written to outside of Next. Care should be taken when closing Rows not to modify a buffer held in dest.
Click to show internal directories.
Click to hide internal directories.