mattermost/server/channels/store/sqlstore
Jesse Hallam 07ba32e849
Some checks failed
API / build (push) Has been cancelled
Server CI / Compute Go Version (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Server CI / Check mocks (push) Has been cancelled
Server CI / Check go mod tidy (push) Has been cancelled
Server CI / check-style (push) Has been cancelled
Server CI / Check serialization methods for hot structs (push) Has been cancelled
Server CI / Vet API (push) Has been cancelled
Server CI / Check migration files (push) Has been cancelled
Server CI / Generate email templates (push) Has been cancelled
Server CI / Check store layers (push) Has been cancelled
Server CI / Check mmctl docs (push) Has been cancelled
Server CI / Postgres with binary parameters (push) Has been cancelled
Server CI / Postgres (push) Has been cancelled
Server CI / Postgres (FIPS) (push) Has been cancelled
Server CI / Generate Test Coverage (push) Has been cancelled
Server CI / Run mmctl tests (push) Has been cancelled
Server CI / Run mmctl tests (FIPS) (push) Has been cancelled
Server CI / Build mattermost server app (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
MM-62151 avoid select * for post store (#34709)
* fix SELECT * in user_store.go

* MM-62151: Avoid SELECT * in post store SQL queries

Replace all SELECT * patterns in post_store.go with explicit column
specifications using postSliceColumns() and postSliceColumnsWithName()
helper functions. This prevents unnecessary data transfer and protects
against schema changes.

Changes:
- Use Squirrel's .Column() method for cleaner query building
- Remove unqueryvet linter exception for post_store.go
- Fix 11 SELECT * occurrences in various query methods

* leverage postsQuery where we can

* more builder simplifications

* add noSelectStar to linter

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-01-09 18:23:16 +00:00
..
access_control_policy_store.go Fix issues with access_control_policies/search endpoint functionality and docs (#34564) 2025-11-25 14:04:14 -05:00
access_control_policy_store_test.go [MM-63428] add access control policy store (#30597) 2025-04-02 13:39:28 +02:00
adapters.go [MM-55595] Use annotated logger in search layer (#25468) 2023-12-04 18:34:57 +01:00
adapters_test.go Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
attributes_store.go MM-65618 - filter based on admin values (#33857) 2025-09-12 20:09:47 +02:00
attributes_store_test.go [MM-61756] Attribute Based Access Control - Phase 1 (#30785) 2025-05-15 11:33:08 +02:00
audit_store.go avoid SELECT * in audit store (#30829) 2025-04-23 08:37:06 +02:00
audit_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
autotranslation_store.go MM-65756 Database Migrations, Indexes and Methods for Auto-Translation (#34047) 2025-11-22 09:32:01 +08:00
autotranslation_store_test.go MM-65756 Database Migrations, Indexes and Methods for Auto-Translation (#34047) 2025-11-22 09:32:01 +08:00
bot_store.go s/Get(Master|Replica)X/Get\1/g (#29520) 2024-12-10 09:57:19 -04:00
bot_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
channel_bookmark_store.go MM-61375: Update file handling for bookmarks (#30034) 2025-02-13 17:11:13 -06:00
channel_bookmark_store_test.go Channel Bookmarks (#25449) 2024-03-12 08:36:05 -06:00
channel_member_history_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
channel_member_history_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
channel_store.go MM-65756 Database Migrations, Indexes and Methods for Auto-Translation (#34047) 2025-11-22 09:32:01 +08:00
channel_store_categories.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
channel_store_categories_test.go [MM-52969] Revert "MM-51482_Create Apps Category and link to bots DM (#22918)" (#23647) 2023-06-14 11:05:21 +02:00
channel_store_test.go [MM-62408] Server Code Coverage with Fully Parallel Tests (#30078) 2025-05-30 13:58:26 +02:00
cluster_discovery_store.go avoid SELECT * in cluster discovery store (#30830) 2025-04-23 05:08:43 +08:00
cluster_discovery_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
command_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
command_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
command_webhook_store.go avoid SELECT * in command stores (#30831) 2025-04-22 19:37:10 +00:00
command_webhook_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
compliance_store.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
compliance_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
content_flagging_store.go Migrate content flagging settings to database (#33989) 2025-10-13 12:24:01 +05:30
content_flagging_store_test.go Migrate content flagging settings to database (#33989) 2025-10-13 12:24:01 +05:30
context.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
context_test.go [MM-62408] Server Code Coverage with Fully Parallel Tests (#30078) 2025-05-30 13:58:26 +02:00
desktop_tokens_store.go s/Get(Master|Replica)X/Get\1/g (#29520) 2024-12-10 09:57:19 -04:00
desktop_tokens_store_test.go [MM-37984] Allow Desktop App to authenticate via external providers outside of the app on supported servers (#24140) 2023-08-30 11:21:43 -04:00
draft_store.go [MM-61758] Burn on read feature (#34703) 2025-12-11 07:59:50 +01:00
draft_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
emoji_store.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
emoji_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
file_info_store.go Filter burn on read posts from search results (#34747) 2025-12-17 16:23:26 +01:00
file_info_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
group_store.go GH-16800/AdminRoleGroupsForSyncableMember (#34077) 2025-10-28 16:27:07 +00:00
group_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
init_test.go [MM-62408] Server Code Coverage with Fully Parallel Tests (#30078) 2025-05-30 13:58:26 +02:00
integrity.go s/Get(Master|Replica)X/Get\1/g (#29520) 2024-12-10 09:57:19 -04:00
integrity_test.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
job_store.go MM-65661 - channel admin abac override previous jobs (#33872) 2025-09-26 12:33:31 +02:00
job_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
license_store.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
license_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
link_metadata_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
link_metadata_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
main_test.go [MM-62408] Server Code Coverage with Fully Parallel Tests (#30078) 2025-05-30 13:58:26 +02:00
migrate.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
migrate_test.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
notify_admin_store.go avoid SELECT * in notify admin store (#30834) 2025-04-22 17:27:33 -03:00
notify_admin_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
oauth_store.go Add support for resource parameter with OAuth (#33743) 2025-11-11 15:24:42 -05:00
oauth_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
outgoing_oauth_connection_store.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
outgoing_oauth_connection_store_test.go [MM-55028] Added OAuthOutgoingConnection store (#25221) 2023-11-20 09:42:07 -05:00
plugin_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
plugin_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
post_acknowledgements_store.go Flag post API (#33765) 2025-10-02 20:24:29 +05:30
post_acknowledgements_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
post_persistent_notification_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
post_persistent_notification_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
post_priority_store.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
post_priority_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
post_store.go MM-62151 avoid select * for post store (#34709) 2026-01-09 18:23:16 +00:00
post_store_test.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
preference_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
preference_store_test.go s/Get(Master|Replica)X/Get\1/g (#29520) 2024-12-10 09:57:19 -04:00
product_notices_store.go Remove SELECT * from product notices store (#31246) 2025-05-31 14:53:42 +05:30
product_notices_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
property_field_store.go [MM-65769] add updatedSince to field search (#34037) 2025-10-08 10:54:29 +00:00
property_field_store_test.go Adds the main Property System Architecture components (#29644) 2025-01-13 11:41:44 +00:00
property_group_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
property_group_store_test.go Adds the main Property System Architecture components (#29644) 2025-01-13 11:41:44 +00:00
property_value_store.go Reviewer search api (#34036) 2025-10-14 09:06:23 +05:30
property_value_store_test.go Adds the main Property System Architecture components (#29644) 2025-01-13 11:41:44 +00:00
reaction_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
reaction_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
read_receipt_store.go [MM-61758] Burn on read feature (#34703) 2025-12-11 07:59:50 +01:00
read_receipt_store_test.go [MM-61758] Burn on read feature (#34703) 2025-12-11 07:59:50 +01:00
remote_cluster_store.go MM-62751: [Shared Channels] Allow remote users to be discoverable in the create DM/GM modal (#30918) 2025-06-13 16:51:12 +02:00
remote_cluster_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
retention_policy_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
retention_policy_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
role_store.go Use golangci-lints's build-in modernize linter (#34341) 2025-11-04 12:09:11 +01:00
role_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
scheduled_post_store.go [MM-61758] Burn on read feature (#34703) 2025-12-11 07:59:50 +01:00
scheduled_post_store_test.go Feature scheduled messages (#28932) 2024-11-04 11:39:35 +05:30
schema_dump.go [MM-57693] Add schema dump to Support Packet (#31162) 2025-06-19 11:33:55 +02:00
schema_dump_test.go MM-65756 Database Migrations, Indexes and Methods for Auto-Translation (#34047) 2025-11-22 09:32:01 +08:00
scheme_store.go Replace SELECT * with explicit column lists in sqlstore (#31356) 2025-06-11 18:16:05 -03:00
scheme_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
session_store.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
session_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
shared_channel_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
shared_channel_store_membership.go MM-52600: [Shared Channels] Shared channels do not sync channel membership (#30976) 2025-06-15 10:07:56 +02:00
shared_channel_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
sqlx_wrapper.go MM-62142: remove SELECT * from status store (round 2) (#30060) 2025-02-06 12:36:31 -04:00
sqlx_wrapper_test.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
status_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
status_store_test.go MM-62142: remove SELECT * from status store (round 2) (#30060) 2025-02-06 12:36:31 -04:00
store.go [MM-61758] Burn on read feature (#34703) 2025-12-11 07:59:50 +01:00
store_test.go Bump Postgres minimum supported version to 14 (#34010) 2025-10-01 09:49:05 +02:00
system_store.go MM-65960: Avoid replica race lag when accessing TelemetryID (#34586) 2025-12-11 17:34:36 -04:00
system_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
team_store.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
team_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
temporary_post_store.go [MM-61758] Burn on read feature (#34703) 2025-12-11 07:59:50 +01:00
temporary_post_store_test.go [MM-61758] Burn on read feature (#34703) 2025-12-11 07:59:50 +01:00
terms_of_service_store.go MM-62160: Avoid SELECT * in user_terms_of_service.go and terms_of_service_store.go (#30423) 2025-03-28 15:44:52 -03:00
terms_of_service_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
testpool.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
thread_store.go [MM-64900] Migrate to use request.CTX instead of context.Context (#33541) 2025-09-18 16:14:24 +02:00
thread_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
tokens_store.go Magic link (passwordless) authentication for guests (#34264) 2025-11-20 14:06:23 +01:00
tokens_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
upload_session_store.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
upload_session_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
user_access_token_store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
user_access_token_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
user_store.go MM-62151 avoid select * for post store (#34709) 2026-01-09 18:23:16 +00:00
user_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
user_terms_of_service.go MM-62160: Avoid SELECT * in user_terms_of_service.go and terms_of_service_store.go (#30423) 2025-03-28 15:44:52 -03:00
user_terms_of_service_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
utils.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
utils_test.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
webhook_store.go MM-62154: Avoid SELECT * in webhook_store.go (#30463) 2025-03-28 21:58:26 +00:00
webhook_store_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30