Documentation ¶
Index ¶
- func ColumnsByRequest(r *http.Request) []string
- func CountByRequest(req *http.Request) (countQuery string, err error)
- func DatabaseClause(req *http.Request) (query string, hasCount bool)
- func Delete(database, schema, table, where string, whereValues []interface{}) (jsonData []byte, err error)
- func ExecuteScripts(method, sql string, values []interface{}) (result []byte, err error)
- func FieldsPermissions(table string, cols []string, op string) []string
- func GetQueryOperator(op string) (string, error)
- func GetScript(verb, folder, scriptName string) (script string, err error)
- func Insert(database, schema, table string, body api.Request) (jsonData []byte, err error)
- func JoinByRequest(r *http.Request) (values []string, err error)
- func OrderByRequest(r *http.Request) (values string, err error)
- func PaginateIfPossible(r *http.Request) (paginatedQuery string, err error)
- func ParseScript(scriptPath string, queryURL url.Values) (sqlQuery string, values []interface{}, err error)
- func Query(SQL string, params ...interface{}) (jsonData []byte, err error)
- func QueryCount(SQL string, params ...interface{}) ([]byte, error)
- func SchemaClause(req *http.Request) (query string, hasCount bool)
- func SelectFields(fields []string) (sql string, err error)
- func TablePermissions(table string, op string) bool
- func Update(database, schema, table, where string, whereValues []interface{}, ...) (jsonData []byte, err error)
- func WhereByRequest(r *http.Request, initialPlaceholderID int) (whereSyntax string, values []interface{}, err error)
- func WriteSQL(sql string, values []interface{}) (resultByte []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColumnsByRequest ¶
ColumnsByRequest extract columns and return as array of strings
func CountByRequest ¶
CountByRequest implements COUNT(fields) OPERTATION
func DatabaseClause ¶
DatabaseClause return a SELECT `query`
func Delete ¶
func Delete(database, schema, table, where string, whereValues []interface{}) (jsonData []byte, err error)
Delete execute delete sql into a table
func ExecuteScripts ¶
ExecuteScripts run sql templates created by users
func FieldsPermissions ¶
FieldsPermissions get fields permissions based in prest configuration
func GetQueryOperator ¶
GetQueryOperator identify operator on a join
func JoinByRequest ¶
JoinByRequest implements join in queries
func OrderByRequest ¶
OrderByRequest implements ORDER BY in queries
func PaginateIfPossible ¶
PaginateIfPossible func
func ParseScript ¶
func ParseScript(scriptPath string, queryURL url.Values) (sqlQuery string, values []interface{}, err error)
ParseScript use values sent by users and add on script
func QueryCount ¶
QueryCount process queries with count
func SchemaClause ¶
SchemaClause return a SELECT `query`
func TablePermissions ¶
TablePermissions get tables permissions based in prest configuration
func Update ¶
func Update(database, schema, table, where string, whereValues []interface{}, body api.Request) (jsonData []byte, err error)
Update execute update sql into a table
Types ¶
This section is empty.