Documentation
¶
Index ¶
- Constants
- func Create(name string) (ret *sql.DB)
- func Ins(db tables.Executer, tablecols []string, els ...interface{}) (err error)
- func Open(name, path, driver string) (ret *sql.DB)
- func PathFromName(name string) (ret string, err error)
- func TableCols(table_cols ...string) []string
- func WriteCsv(db tables.Querier, w io.Writer, tablecols []string, where string) (err error)
Constants ¶
const Memory = "file:test.db?cache=shared&mode=memory"
Variables ¶
This section is empty.
Functions ¶
func Create ¶
if you run the test as "go test ... -args write" it'll write the db out in your user (home) directory
func Ins ¶
insert an arbitrary number of rows into the passed db. tablecols holds the names of the table and columns to query, els can hold multiple rows of data, each containing the number of cols specified by tablecols.
func Open ¶
Opens a (sqlite) database in memory or on disk, panicking on error. To create a memory table: pass "Memory" as the path. If path is empty, uses the users's home directory. If driver is empty, assumes a sqlite database. If the db/file does not already exist, it will be created.
func PathFromName ¶
from testing.T.Name() return a local db testing path
func TableCols ¶
given a table name, and list of column names return a super-secret helper. ( used for Ins, and WriteCsv )
Types ¶
This section is empty.