parsing

package
v0.0.0-...-aff0e78 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyntaxErrorPrefix = "SYNTAX-ERROR:"
)

Variables

This section is empty.

Functions

func CoerceToColumnType

func CoerceToColumnType(key string, v interface{}, columns []defs.DBColumn) (interface{}, error)

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 ColumnList(columnsParameter string) string

func ColumnsFromURL

func ColumnsFromURL(u *url.URL) string

func FiltersFromURL

func FiltersFromURL(u *url.URL) []string

filtersFromURL extracts the filter parameters from the urL, and creates an array of strings for each filter expression found.

func FormCondition

func FormCondition(condition string) (string, error)

func FormCreateQuery

func FormCreateQuery(u *url.URL, user string, hasAdminPrivileges bool, items []defs.DBColumn, sessionID int, w http.ResponseWriter, provider string, useRowID bool) (string, error)

func FormInsertQuery

func FormInsertQuery(table string, user string, provider string, columns []defs.DBColumn, items map[string]interface{}) (string, []interface{}, error)

func FormSelectorDeleteQuery

func FormSelectorDeleteQuery(u *url.URL, filter []string, columns string, table string, user string, verb string, provider string) (string, error)

func FormUpdateQuery

func FormUpdateQuery(u *url.URL, user, provider string, columns []defs.DBColumn, items map[string]interface{}) (string, []interface{}, error)

func FullName

func FullName(user, table string) (string, bool)

func KeywordMatch

func KeywordMatch(k string, list ...string) bool

func MapColumnType

func MapColumnType(native string) string

mapColumnType converts native Ego types into the equivalent Postgres data types.

func PagingClauses

func PagingClauses(u *url.URL) string

func QueryParameters

func QueryParameters(source string, args map[string]string) (string, error)

func RequestForUser

func RequestForUser(user string, u *url.URL) string

With a default user name string, and the current URL, determine if the username should be overridden with one from the URL.

func SQLEscape

func SQLEscape(source string) (string, error)

func SortList

func SortList(u *url.URL) string

func StripQuotes

func StripQuotes(input string) string

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 TableNameFromRequest

func TableNameFromRequest(r *http.Request) (string, error)

func TableNameFromURL

func TableNameFromURL(u *url.URL) (string, error)

func TableNameParts

func TableNameParts(user string, name string) []string

func WhereClause

func WhereClause(filters []string) (string, error)

whereClause accepts a list of filter parameters, and converts them to a SQL WHERE clause (including the 'WHERE' token).

Types

This section is empty.

Jump to

Keyboard shortcuts

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