mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-08-11 13:37:45 +00:00
Use xorm quoter for feed query (#5018)
This commit is contained in:
parent
d53fa6d74d
commit
c4b22cc493
@ -41,7 +41,7 @@ pipelines.author as pipeline_author,
|
|||||||
pipelines.email as pipeline_email,
|
pipelines.email as pipeline_email,
|
||||||
pipelines.avatar as pipeline_avatar`
|
pipelines.avatar as pipeline_avatar`
|
||||||
|
|
||||||
return fmt.Sprintf(feedTemplate, s.quoteIdentifier("commit"))
|
return fmt.Sprintf(feedTemplate, s.engine.Dialect().Quoter().Quote("commit"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s storage) GetPipelineQueue() ([]*model.Feed, error) {
|
func (s storage) GetPipelineQueue() ([]*model.Feed, error) {
|
||||||
|
@ -76,15 +76,3 @@ func callerName(skip int) string {
|
|||||||
}
|
}
|
||||||
return fnName
|
return fnName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s storage) quoteIdentifier(identifier string) string {
|
|
||||||
driver := s.engine.DriverName()
|
|
||||||
switch driver {
|
|
||||||
case DriverMysql:
|
|
||||||
return "`" + identifier + "`"
|
|
||||||
case DriverPostgres, DriverSqlite:
|
|
||||||
return "\"" + identifier + "\""
|
|
||||||
default:
|
|
||||||
return identifier
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user