Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is the error returned, if the entity is not found in the DB. ErrNotFound = errors.New("Not found") // ErrConflict is the error returned, if the adding or updating an entity // causes a conflict with an existing entity. ErrConflict = errors.New("Conflict") )
var PreparedStmts = map[int]*sql.Stmt{}
PreparedStmts is a placeholder for transitioning to package-scoped transaction functions.
Functions ¶
func PrepareStmts ¶
PrepareStmts prepares all registered statements and returns an index from statement code to prepared statement object.
func RegisterStmt ¶
RegisterStmt register a SQL statement.
Registered statements will be prepared upfront and reused, to speed up execution.
Return a unique registration code.
func StmtString ¶
StmtString returns the in-memory query string with the given code.
Types ¶
type Marshaler ¶
Marshaler is the interface that wraps the MarshalDB method, which converts the underlying type into a string representation suitable for persistence in the database.
type Unmarshaler ¶
Unmarshaler is the interface that wraps the UnmarshalDB method, which converts a string representation retrieved from the database into the underlying type.