Documentation
¶
Index ¶
- Constants
- func CoerceToColumnType(key string, v interface{}, columns []defs.DBColumn) (interface{}, error)
- func ColumnList(columnsParameter string) string
- func ColumnsFromURL(u *url.URL) string
- func FiltersFromURL(u *url.URL) []string
- func FormCondition(condition string) (string, error)
- func FormCreateQuery(u *url.URL, user string, hasAdminPrivileges bool, items []defs.DBColumn, ...) (string, error)
- func FormInsertQuery(table string, user string, provider string, columns []defs.DBColumn, ...) (string, []interface{}, error)
- func FormSelectorDeleteQuery(u *url.URL, filter []string, columns string, table string, user string, ...) (string, error)
- func FormUpdateQuery(u *url.URL, user, provider string, columns []defs.DBColumn, ...) (string, []interface{}, error)
- func FullName(user, table string) (string, bool)
- func KeywordMatch(k string, list ...string) bool
- func MapColumnType(native string) string
- func PagingClauses(u *url.URL) string
- func QueryParameters(source string, args map[string]string) (string, error)
- func RequestForUser(user string, u *url.URL) string
- func SQLEscape(source string) (string, error)
- func SortList(u *url.URL) string
- func StripQuotes(input string) string
- func TableNameFromRequest(r *http.Request) (string, error)
- func TableNameFromURL(u *url.URL) (string, error)
- func TableNameParts(user string, name string) []string
- func WhereClause(filters []string) (string, error)
Constants ¶
const (
SyntaxErrorPrefix = "SYNTAX-ERROR:"
)
Variables ¶
This section is empty.
Functions ¶
func CoerceToColumnType ¶
For a given column name and value, and the metadata for the columns, ensure that the value is of the correct type based on the column. If the value cannot be converted, return an error.
func ColumnList ¶
func ColumnsFromURL ¶
func FiltersFromURL ¶
filtersFromURL extracts the filter parameters from the urL, and creates an array of strings for each filter expression found.
func FormCondition ¶
func FormCreateQuery ¶
func FormInsertQuery ¶
func FormSelectorDeleteQuery ¶
func FormUpdateQuery ¶
func KeywordMatch ¶
func MapColumnType ¶
mapColumnType converts native Ego types into the equivalent Postgres data types.
func PagingClauses ¶
func RequestForUser ¶
With a default user name string, and the current URL, determine if the username should be overridden with one from the URL.
func StripQuotes ¶
StripQuotes removes double quotes from the input string. Leading and trailing double-quotes are removed, as are internal "." quoted boundaries. This prevents a name from being put through the FullName() processor multiple times and accumulating extra quotes.
func TableNameParts ¶
func WhereClause ¶
whereClause accepts a list of filter parameters, and converts them to a SQL WHERE clause (including the 'WHERE' token).
Types ¶
This section is empty.