sql

package
v0.2.1-0...-e2a08ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFilterToQuery

func AddFilterToQuery(f *humamw.FilterGroup, whereToColumnMap map[string]string,
	orderToColumnMap map[string]string, query string, params []any) (string, []any, error)

Injects the filter (WHERE and ORDER BY) to the query.

If the column being filtered by is not present in the filterToColumnMap but is present in the filter definition in the middleware, no error will happen. This is because you may want to apply specific filters in a query, and other filters in other queries.

Note: May fail if the query has a JOIN, and does not have a WHERE clause. This can be botched by adding a WHERE TRUE clause, or, if you feel like it, editing string manipulation code to contemplate that case.

func IndexInMainQuery

func IndexInMainQuery(query string, substr string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL