Documentation
¶
Overview ¶
The db package manages the Ego data base interfaces, similar to the sql package in conventional Go. There is basic functionality for creating a new connection, and then using that connection object (a db.Client) to perform queries, etc. A db.Rows type is also defined for row sets.
Index ¶
- Variables
- func AsStructures(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Begin(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Close(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Commit(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Execute(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func New(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Query(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func QueryResult(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Rollback(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
var ClientType *data.Type
var RowsType *data.Type
Functions ¶
func AsStructures ¶
func AsStructures(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
AsStructures sets the asStruct flag. When true, result sets from queries are an array of structs, where the struct members are the same as the result set column names. When not true, the result set is an array of arrays, where the inner array contains the column data in the order of the result set, but with no labels, etc.
func Begin ¶
func Begin(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Begin implements the Begin() db function. This allocated a new structure that contains all the info needed to call the database, including the function pointers for the functions available to a specific handle.
func Close ¶
func Close(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Close closes the database connection, frees up any resources held, and resets the handle contents to prevent re-using the connection.
func Commit ¶
func Commit(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Commit implements the Commit() db function.
func Execute ¶
func Execute(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Execute executes a SQL statement, and returns the number of rows that were affected by the statement (such as number of rows deleted for a DELETE statement).
func New ¶
func New(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
New implements the New() db function. This allocated a new structure that contains all the info needed to call the database, including the function pointers for the functions available to a specific handle.
func Query ¶
func Query(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Query executes a query, with optional parameter substitution, and returns row object for subsequent calls to fetch the data.
func QueryResult ¶
func QueryResult(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
QueryResult executes a query, with optional parameter substitution, and returns the entire result set as an array in a single operation.
func Rollback ¶
func Rollback(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Rollback implements the Rollback() db function.
Types ¶
This section is empty.