-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fill out API with Selectf/v, add MustExec alias for Execp as MustFunc…
… is more go-idiomatic
- Loading branch information
Showing
2 changed files
with
81 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// General purpose extensions to database/sql | ||
// | ||
// sqlx is intended to seamlessly wrap database/sql and provide some convenience | ||
// methods which range from basic common error handling techniques to complex | ||
// reflect-base Scan extensions. Replacing `sql.Open` with `sqlx.Open` should | ||
// provide access to most of the features within sqlx while not changing the | ||
// interface used by any existing code. | ||
// | ||
// sqlx introduces the following concepts which are accessible wherever they | ||
// make sense: | ||
// | ||
// The addition of a mnemonic set of "Exec" functions: | ||
// | ||
// Execv - log.Println errors, return (rows, err) | ||
// Execl - log.Println errors, return only rows | ||
// Execp - panic(err) on error | ||
// Execf - log.Fatal(err) on error | ||
// MustExec - same as Execp | ||
// | ||
// The addition of a "StructScan" function, which takes an the result from a | ||
// query and a struct slice and automatically scans each row as a struct. | ||
// | ||
// The addition of a set of "Select" functions, which combine Query and | ||
// StructScan and have "f" and "v" error handling variantes like Exec. | ||
// | ||
// A "LoadFile" convenience function which executes the queries in a file. | ||
// | ||
// Panicing variants of Connect and Begin: MustConnect, MustBegin. | ||
// | ||
|
||
package sqlx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters