Channel Store: No SELECT * (#32167)
* Replace SELECT * with explicit column lists in channel store Migrates channel_store.go away from SELECT * patterns to explicit column lists for better performance, maintainability, and schema safety. - Replace GetPinnedPosts raw SQL with query builder using postSliceColumns() - Replace "cc.*" in group channel search with channelSliceColumns() - Replace GetChannelsBatchForIndexing raw SQL with query builder - Replace channel member and team queries with respective column helpers - Use SelectBuilder helper instead of manual ToSql() calls 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Replace SELECT * with COUNT(*) in user_test.go Replaces unnecessary SELECT * queries with SELECT COUNT(*) in TestPermanentDeleteUser bot count verification. Only needs to check the count of bots, not retrieve full bot records. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fb9b05b764
Коммит
ebe03c1d45
@@ -1248,12 +1248,12 @@ func TestPermanentDeleteUser(t *testing.T) {
|
||||
})
|
||||
assert.Nil(t, err)
|
||||
|
||||
bots1 := []*model.Bot{}
|
||||
bots2 := []*model.Bot{}
|
||||
var botCount1 int
|
||||
var botCount2 int
|
||||
|
||||
err1 := th.SQLStore.GetMaster().Select(&bots1, "SELECT * FROM Bots")
|
||||
err1 := th.SQLStore.GetMaster().Get(&botCount1, "SELECT COUNT(*) FROM Bots")
|
||||
assert.NoError(t, err1)
|
||||
assert.Equal(t, 1, len(bots1))
|
||||
assert.Equal(t, 1, botCount1)
|
||||
|
||||
// test that bot is deleted from bots table
|
||||
retUser1, err := th.App.GetUser(bot.UserId)
|
||||
@@ -1262,9 +1262,9 @@ func TestPermanentDeleteUser(t *testing.T) {
|
||||
err = th.App.PermanentDeleteUser(th.Context, retUser1)
|
||||
assert.Nil(t, err)
|
||||
|
||||
err1 = th.SQLStore.GetMaster().Select(&bots2, "SELECT * FROM Bots")
|
||||
err1 = th.SQLStore.GetMaster().Get(&botCount2, "SELECT COUNT(*) FROM Bots")
|
||||
assert.NoError(t, err1)
|
||||
assert.Equal(t, 0, len(bots2))
|
||||
assert.Equal(t, 0, botCount2)
|
||||
|
||||
scheduledPost1 := &model.ScheduledPost{
|
||||
Draft: model.Draft{
|
||||
|
||||
Ссылка в новой задаче
Block a user