Documentation ¶
Overview ¶
Package generateseries provides a port of the generate_series table-valued function from the SQLite tree.
Example ¶
package main import ( "fmt" "log" "zombiezen.com/go/sqlite" "zombiezen.com/go/sqlite/ext/generateseries" "zombiezen.com/go/sqlite/sqlitex" ) func main() { conn, err := sqlite.OpenConn(":memory:") if err != nil { log.Fatal(err) } defer conn.Close() if err := generateseries.Register(conn); err != nil { log.Fatal(err) } err = sqlitex.ExecuteTransient( conn, `SELECT * FROM generate_series(0, 20, 5);`, &sqlitex.ExecOptions{ ResultFunc: func(stmt *sqlite.Stmt) error { fmt.Printf("%2d\n", stmt.ColumnInt(0)) return nil }, }, ) if err != nil { log.Fatal(err) } }
Output: 0 5 10 15 20
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = &sqlite.Module{
Connect: connect,
}
Module is a virtual table module that can be registered with sqlite.Conn.SetModule.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.