MM-62142: remove SELECT * from status store (round 2) (#30060)

* Revert "Revert "[MM-62142] Avoid SELECT * in status_store.go (#29610)" (#29985)"

This reverts commit d345e92136.

* add tests for StatusGet and StatusGetByIds

* handle NULL columns in the Status Store

* simplify status store

* more builder simplifications and tests

* expose GetQueryPlaceholder

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Jesse Hallam
2025-02-06 12:36:31 -04:00
коммит произвёл GitHub
родитель c4718e4542
Коммит 7d9521d783
6 изменённых файлов: 282 добавлений и 89 удалений

Просмотреть файл

@@ -4,6 +4,8 @@
package storetest
import (
"fmt"
"github.com/mattermost/mattermost/server/public/model"
)
@@ -19,3 +21,16 @@ func NewTestID() string {
return string(newID)
}
// Adds backtiks to the column name for MySQL, this is required if
// the column name is a reserved keyword.
//
// `ColumnName` - MySQL
// ColumnName - Postgres
func quoteColumnName(driver string, columnName string) string {
if driver == model.DatabaseDriverMysql {
return fmt.Sprintf("`%s`", columnName)
}
return columnName
}