Documentation ¶
Index ¶
Constants ¶
View Source
const (
// ErrDup contains the errcode of a unique constraint violation
ErrDup = "23505"
)
View Source
const ISO8601 = "2006-01-02T15:04:05-0700"
ISO8601 is a time.Time layout for the ISO8601 format
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
IsNotFound checks if an error is triggered by an empty result
func NamedSelect ¶
NamedSelect is the same as sqlx.Select() but with named params
Types ¶
type Queryable ¶
type Queryable interface { sqlx.Execer sqlx.Queryer sqlx.Preparer BindNamed(query string, arg interface{}) (string, []interface{}, error) DriverName() string Get(dest interface{}, query string, args ...interface{}) error MustExec(query string, args ...interface{}) sql.Result NamedExec(query string, arg interface{}) (sql.Result, error) NamedQuery(query string, arg interface{}) (*sqlx.Rows, error) PrepareNamed(query string) (*sqlx.NamedStmt, error) Preparex(query string) (*sqlx.Stmt, error) Rebind(query string) string Select(dest interface{}, query string, args ...interface{}) error }
Queryable represent a global interface for transactions, prepared statement, etc.
var Writer Queryable
Writer represents an open connection to the database
type Time ¶
Time represents a time.Time that uses ISO8601 for json input/output instead of RFC3339
func (Time) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface
Click to show internal directories.
Click to hide internal directories.