Documentation
¶
Index ¶
- Constants
- Variables
- func AddJoin(selectStmt *pg_query.SelectStmt, joinType pg_query.JoinType, ...)
- func AddSetClause(updateStmt *pg_query.UpdateStmt, columnName string, paramIndex int)
- func AddWhereNode(selectStmt *pg_query.SelectStmt, node *pg_query.Node)
- func ClearOrderByClause(selectStmt *pg_query.SelectStmt)
- func ClearWithClause(selectStmt *pg_query.SelectStmt)
- func ContextWithLogger(ctx context.Context, l *slog.Logger) context.Context
- func GetSQL(result *pg_query.ParseResult) string
- func Logger(ctx context.Context) *slog.Logger
- func MakeAndExprNode(left, right *pg_query.Node) *pg_query.Node
- func MakeColumnRefNode(tableAlias, columnName string) *pg_query.Node
- func MakeIsNotNullNode(node *pg_query.Node) *pg_query.Node
- func MakeIsNullNode(node *pg_query.Node) *pg_query.Node
- func MakeLikeExprNode(left, right *pg_query.Node) *pg_query.Node
- func MakeOpExprNode(op string, left, right *pg_query.Node) *pg_query.Node
- func MakeOrExprNode(left, right *pg_query.Node) *pg_query.Node
- func MakeParamNode(index int) *pg_query.Node
- func Marshal(w http.ResponseWriter, r *http.Request, statusCode int, v any) error
- func ParseRowsRange(r string) (int, int, error)
- func RemoveLimit(selectStmt *pg_query.SelectStmt)
- func RemoveOffset(selectStmt *pg_query.SelectStmt)
- func ReplaceSelectTargetsWithCountRows(selectStmt *pg_query.SelectStmt)
- func RequestWithLogger(r *http.Request, l *slog.Logger) *http.Request
- func ServeError(w http.ResponseWriter, r *http.Request, err error) (httpCode int)
- func SetLimit(selectStmt *pg_query.SelectStmt, count int64)
- func SetOffset(selectStmt *pg_query.SelectStmt, offset int64)
- func SetOrderBy(selectStmt *pg_query.SelectStmt, elements []string) error
- func UnmarshalBody(r *http.Request, v any) error
Constants ¶
View Source
const DefaultCurrency = "USD"
View Source
const (
QueryNilValue = "<nil>"
)
Variables ¶
View Source
var ( ErrBadRequest = errors.New(http.StatusText(http.StatusBadRequest)) // ErrBadRequest indicates malformed syntax, etc. ErrForbidden = errors.New(http.StatusText(http.StatusForbidden)) // ErrForbidden indicates lack of necessary permissions. ErrNotFound = errors.New(http.StatusText(http.StatusNotFound)) // ErrNotFound indicates resource could not be found. ErrMethodNotAllowed = errors.New(http.StatusText(http.StatusMethodNotAllowed)) // ErrMethodNotAllowed indicates method not supported by resource. ErrNotAcceptable = errors.New(http.StatusText(http.StatusNotAcceptable)) // ErrNotAcceptable indicates no client-acceptable media type for resource. ErrConflict = errors.New(http.StatusText(http.StatusConflict)) // ErrConflict indicates a conflict the user must resolve and resubmit. ErrGone = errors.New(http.StatusText(http.StatusGone)) // ErrGone indicates the resource is no longer available. ErrPreconditionFailed = errors.New(http.StatusText(http.StatusPreconditionFailed)) // ErrPreconditionFailed indicates one or more request conditions are false. ErrUnsupportedMediaType = errors.New(http.StatusText(http.StatusUnsupportedMediaType)) // ErrUnsupportedMediaType indicates payload media type is not supported. ErrRequestedRangeNotSatisfiable = errors.New(http.StatusText(http.StatusRequestedRangeNotSatisfiable)) // ErrRequestedRangeNotSatisfiable indicates the given Range cannot be satisfied. ErrUnprocessableEntity = errors.New(http.StatusText(http.StatusUnprocessableEntity)) // ErrUnprocessableEntity indicates request payload is well-formed syntactically but not semantically. ErrLocked = errors.New(http.StatusText(http.StatusLocked)) // ErrLocked indicates that the resource is currently locked. ErrPreconditionRequired = errors.New(http.StatusText(http.StatusPreconditionRequired)) // ErrPreconditionRequired indicates request must be conditional but isn't. ErrInternalError = errors.New(http.StatusText(http.StatusInternalServerError)) // ErrInternalError indicates an unexpected internal server error. ErrNotImplemented = errors.New(http.StatusText(http.StatusNotImplemented)) // ErrNotImplemented indicates that a requested operation is not implemented. )
Functions ¶
func AddSetClause ¶
func AddSetClause(updateStmt *pg_query.UpdateStmt, columnName string, paramIndex int)
func AddWhereNode ¶
func AddWhereNode(selectStmt *pg_query.SelectStmt, node *pg_query.Node)
func ClearOrderByClause ¶
func ClearOrderByClause(selectStmt *pg_query.SelectStmt)
func ClearWithClause ¶
func ClearWithClause(selectStmt *pg_query.SelectStmt)
func ContextWithLogger ¶
func GetSQL ¶
func GetSQL(result *pg_query.ParseResult) string
func MakeColumnRefNode ¶
func MakeParamNode ¶
func RemoveLimit ¶
func RemoveLimit(selectStmt *pg_query.SelectStmt)
func RemoveOffset ¶
func RemoveOffset(selectStmt *pg_query.SelectStmt)
func ReplaceSelectTargetsWithCountRows ¶
func ReplaceSelectTargetsWithCountRows(selectStmt *pg_query.SelectStmt)
func ServeError ¶
func SetLimit ¶
func SetLimit(selectStmt *pg_query.SelectStmt, count int64)
func SetOffset ¶
func SetOffset(selectStmt *pg_query.SelectStmt, offset int64)
func SetOrderBy ¶
func SetOrderBy(selectStmt *pg_query.SelectStmt, elements []string) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.