MM-19336 Migrated GetMembersByIds and GetMembersByChannelIds to Squirrel (#19728)
* Ported GetMembersByIds and GetMembersByChannelIds to Squirrel * Added checks for empty ID lists * Updated GetAllChannelMembersById to use Squirrel * Added a method to get the query placeholder directly * Migrated UpdateMultipleMembers to use a Squirrel query * Migrated UpdateMultipleMembers to Squirrel * Initialize a prepared query builder for channelMembersForTeamWithSchemeSelectQuery * Migrated GetMembersForUser to Squirrel * Slight improvement for constructMySQLJSONArgs * Migrated UpdateMemberNotifyProps to Squirrel * Migrated GetMembers to Squirrel * Migrated GetMember to Squirrel * Avoid shadowing err * Don't set query builder on copy of SqlChannelStore * Fixed typo in error message * Fixed missing elipsis * Shorter SQL generation for GetAllChannelMembersById * Don't unnecessarily copy the reference * Use a function to generate the ChannelMember map * Avoid shadowing err * Don't use IN for matching multiple possible values * Initialize the members lists * Remove check for empty channelIDs list * Fixed test and removed check for empty list * Use err2 rather than eerr Co-authored-by: Tim Scheuermann <tim@plusmid.dev> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f5b6e09965
Коммит
caa30c9bc4
@@ -961,11 +961,14 @@ func (ss *SqlStore) DropAllTables() {
|
||||
}
|
||||
|
||||
func (ss *SqlStore) getQueryBuilder() sq.StatementBuilderType {
|
||||
builder := sq.StatementBuilder.PlaceholderFormat(sq.Question)
|
||||
return sq.StatementBuilder.PlaceholderFormat(ss.getQueryPlaceholder())
|
||||
}
|
||||
|
||||
func (ss *SqlStore) getQueryPlaceholder() sq.PlaceholderFormat {
|
||||
if ss.DriverName() == model.DatabaseDriverPostgres {
|
||||
builder = builder.PlaceholderFormat(sq.Dollar)
|
||||
return sq.Dollar
|
||||
}
|
||||
return builder
|
||||
return sq.Question
|
||||
}
|
||||
|
||||
// getSubQueryBuilder is necessary to generate the SQL query and args to pass to sub-queries because squirrel does not support WHERE clause in sub-queries.
|
||||
|
||||
Ссылка в новой задаче
Block a user