1
0
Fork 0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-04-26 05:24:45 +00:00

Use xorm quoter for feed query ()

This commit is contained in:
6543 2025-03-26 19:37:38 +01:00 committed by GitHub
parent d53fa6d74d
commit c4b22cc493
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 13 deletions
server/store/datastore

View file

@ -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) {

View file

@ -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
}
}