mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 05:24:45 +00:00
Use xorm quoter for feed query (#5018)
This commit is contained in:
parent
d53fa6d74d
commit
c4b22cc493
2 changed files with 1 additions and 13 deletions
|
@ -41,7 +41,7 @@ pipelines.author as pipeline_author,
|
|||
pipelines.email as pipeline_email,
|
||||
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) {
|
||||
|
|
|
@ -76,15 +76,3 @@ func callerName(skip int) string {
|
|||
}
|
||||
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 a new issue