MCPcopy Create free account
hub / github.com/apache/devlake / validateQuery

Function validateQuery

backend/impls/dalgorm/dalgorm.go:151–156  ·  view source on GitHub ↗
(query string)

Source from the content-addressed store, hash-verified

149var txPattern = regexp.MustCompile(`(?i)^[\s;]*(begin|(start\s+transaction))[\s;]*$`)
150
151func validateQuery(query string) errors.Error {
152 if txPattern.MatchString(query) { // regexp.MatchString is thread-safe
153 return errors.Default.New("illegal invocation, use the `Begin()` method instead")
154 }
155 return nil
156}
157
158func (d *Dalgorm) unwrapDynamic(entityPtr *interface{}, clausesPtr *[]dal.Clause) {
159 if dynamic, ok := (*entityPtr).(models.DynamicTabler); ok {

Callers 2

Test_validateQueryFunction · 0.85
ExecMethod · 0.85

Calls 1

NewMethod · 0.65

Tested by 1

Test_validateQueryFunction · 0.68