Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update default equation in where clause (#4342)

boojack660616b29dd0
diff --git a/store/activity.go b/store/activity.go
index 3c289ce86f..e65b0d9f7f 100644
--- a/store/activity.go
+++ b/store/activity.go
@@ -333,7 +333,7 @@ func createActivityImpl(ctx context.Context, tx *Tx, creates ...*api.ActivityCre
func findActivityImpl(ctx context.Context, tx *Tx, find *api.ActivityFind) ([]*activityRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/anomaly.go b/store/anomaly.go
index b47d8334ff..0e48cc66b4 100644
--- a/store/anomaly.go
+++ b/store/anomaly.go
@@ -265,7 +265,7 @@ func createAnomalyImpl(ctx context.Context, tx *Tx, upsert *api.AnomalyUpsert) (
func findAnomalyListImpl(ctx context.Context, tx *Tx, find *api.AnomalyFind) ([]*anomalyRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.InstanceID; v != nil {
where, args = append(where, fmt.Sprintf("instance_id = $%d", len(args)+1)), append(args, *v)
if find.InstanceOnly {
diff --git a/store/backup.go b/store/backup.go
index c2a06cec1d..427800912d 100644
--- a/store/backup.go
+++ b/store/backup.go
@@ -421,7 +421,7 @@ func (*Store) createBackupImpl(ctx context.Context, tx *Tx, create *api.BackupCr
func (*Store) findBackupImpl(ctx context.Context, tx *Tx, find *api.BackupFind) ([]*backupRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
@@ -590,7 +590,7 @@ func (s *Store) findBackupSettingRaw(ctx context.Context, find api.BackupSetting
defer tx.Rollback()
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.InstanceID; v != nil {
// Relation backup_setting do not have the column "instance_id", so we should join relation db to add the condition.
where, args = append(where, fmt.Sprintf("db.instance_id = $%d", len(args)+1)), append(args, *v)
@@ -642,7 +642,7 @@ func (s *Store) findBackupSettingRaw(ctx context.Context, find api.BackupSetting
func (*Store) findBackupSettingImpl(ctx context.Context, tx *Tx, find *api.BackupSettingFind) ([]*backupSettingRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/bookmark.go b/store/bookmark.go
index 44875a2939..ed53677946 100644
--- a/store/bookmark.go
+++ b/store/bookmark.go
@@ -222,7 +222,7 @@ func createBookmarkImpl(ctx context.Context, tx *Tx, create *api.BookmarkCreate)
func findBookmarkImpl(ctx context.Context, tx *Tx, find *api.BookmarkFind) ([]*bookmarkRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/data_source.go b/store/data_source.go
index ee76e0e294..612d99600f 100644
--- a/store/data_source.go
+++ b/store/data_source.go
@@ -316,7 +316,7 @@ func (*Store) createDataSourceImpl(ctx context.Context, tx *Tx, create *api.Data
func (*Store) findDataSourceImpl(ctx context.Context, tx *Tx, find *api.DataSourceFind) ([]*dataSourceRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/database.go b/store/database.go
index a905876823..8bfa3c50b4 100644
--- a/store/database.go
+++ b/store/database.go
@@ -477,7 +477,7 @@ func (s *Store) UpdateDatabase(ctx context.Context, patch *UpdateDatabaseMessage
}
func (*Store) listDatabaseImplV2(ctx context.Context, tx *Tx, find *FindDatabaseMessage) ([]*DatabaseMessage, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if !find.IncludeAllDatabase {
where, args = append(where, fmt.Sprintf("db.name != $%d", len(args)+1)), append(args, api.AllDatabaseName)
}
diff --git a/store/db_schema.go b/store/db_schema.go
index 2fc25cd62d..e9957a4235 100644
--- a/store/db_schema.go
+++ b/store/db_schema.go
@@ -24,7 +24,7 @@ func (s *Store) GetDBSchema(ctx context.Context, databaseID int) (*DBSchema, err
}
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
where, args = append(where, fmt.Sprintf("database_id = $%d", len(args)+1)), append(args, databaseID)
tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})
diff --git a/store/deploy.go b/store/deploy.go
index 8f455dfcc9..8ca434810d 100644
--- a/store/deploy.go
+++ b/store/deploy.go
@@ -151,7 +151,7 @@ func (s *Store) getDeploymentConfigImpl(ctx context.Context, find *api.Deploymen
defer tx.Rollback()
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/environment.go b/store/environment.go
index 44bf313d22..43dc31af6c 100644
--- a/store/environment.go
+++ b/store/environment.go
@@ -391,7 +391,7 @@ func (*Store) getEnvironmentImplV2(ctx context.Context, tx *Tx, find *FindEnviro
}
func listEnvironmentImplV2(ctx context.Context, tx *Tx, find *FindEnvironmentMessage) ([]*EnvironmentMessage, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ResourceID; v != nil {
where, args = append(where, fmt.Sprintf("environment.resource_id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/external_approval.go b/store/external_approval.go
index f35a3ac2a8..d32a9234b1 100644
--- a/store/external_approval.go
+++ b/store/external_approval.go
@@ -220,7 +220,7 @@ func (*Store) createExternalApprovalImpl(ctx context.Context, tx *Tx, create *ap
}
func (*Store) findExternalApprovalImpl(ctx context.Context, tx *Tx, find *api.ExternalApprovalFind) ([]*externalApprovalRaw, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
where, args = append(where, fmt.Sprintf("row_status = $%d", len(args)+1)), append(args, api.Normal)
if v := find.IssueID; v != nil {
where, args = append(where, fmt.Sprintf("issue_id = $%d", len(args)+1)), append(args, *v)
diff --git a/store/idp.go b/store/idp.go
index 3cff9bcdb6..ce084321c1 100644
--- a/store/idp.go
+++ b/store/idp.go
@@ -216,7 +216,7 @@ func (*Store) updateIdentityProviderImpl(ctx context.Context, tx *Tx, patch *Upd
}
func (*Store) listIdentityProviderImpl(ctx context.Context, tx *Tx, find *FindIdentityProviderMessage) ([]*IdentityProviderMessage, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ResourceID; v != nil {
where, args = append(where, fmt.Sprintf("resource_id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/inbox.go b/store/inbox.go
index 1516893f68..339134db4e 100644
--- a/store/inbox.go
+++ b/store/inbox.go
@@ -260,7 +260,7 @@ func (s *Store) createInboxImpl(ctx context.Context, tx *Tx, create *api.InboxCr
func findInboxImpl(ctx context.Context, tx *Tx, find *api.InboxFind) ([]*inboxRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
where = append(where, "inbox.activity_id = activity.id")
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("inbox.id = $%d", len(args)+1)), append(args, *v)
diff --git a/store/instance.go b/store/instance.go
index 4f86f7788b..cd4b37f1f4 100644
--- a/store/instance.go
+++ b/store/instance.go
@@ -546,7 +546,7 @@ func patchInstanceImpl(ctx context.Context, tx *Tx, patch *InstancePatch) (*inst
func findInstanceQuery(find *api.InstanceFind) (string, []interface{}) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
@@ -847,7 +847,7 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
}
func (s *Store) listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstanceMessage) ([]*InstanceMessage, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.EnvironmentID; v != nil {
where, args = append(where, fmt.Sprintf("environment.resource_id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/instance_user.go b/store/instance_user.go
index 7c7cb25bd3..f978cff1f5 100644
--- a/store/instance_user.go
+++ b/store/instance_user.go
@@ -148,7 +148,7 @@ func getInstanceUsersDiff(oldInstanceUsers, instanceUsers []*InstanceUserMessage
}
func listInstanceUsersImpl(ctx context.Context, tx *Tx, find *FindInstanceUserMessage) ([]*InstanceUserMessage, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
where, args = append(where, fmt.Sprintf("instance_id = $%d", len(args)+1)), append(args, find.InstanceUID)
if v := find.Name; v != nil {
diff --git a/store/issue.go b/store/issue.go
index 379b75475d..d9303b8f4a 100644
--- a/store/issue.go
+++ b/store/issue.go
@@ -631,7 +631,7 @@ func (*Store) createIssueImpl(ctx context.Context, tx *Tx, create *api.IssueCrea
func (*Store) findIssueImpl(ctx context.Context, tx *Tx, find *api.IssueFind) ([]*issueRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/issue_subscriber.go b/store/issue_subscriber.go
index 9cfc16f2d0..d216036300 100644
--- a/store/issue_subscriber.go
+++ b/store/issue_subscriber.go
@@ -158,7 +158,7 @@ func createIssueSubscriberImpl(ctx context.Context, tx *Tx, create *api.IssueSub
func findIssueSubscriberImpl(ctx context.Context, tx *Tx, find *api.IssueSubscriberFind) ([]*issueSubscriberRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.IssueID; v != nil {
where, args = append(where, fmt.Sprintf("issue_id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/pipeline.go b/store/pipeline.go
index c452902240..e6b812ea85 100644
--- a/store/pipeline.go
+++ b/store/pipeline.go
@@ -289,7 +289,7 @@ func (*Store) createPipelineImpl(ctx context.Context, tx *Tx, create *api.Pipeli
func (*Store) findPipelineImpl(ctx context.Context, tx *Tx, find *api.PipelineFind) ([]*pipelineRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/policy.go b/store/policy.go
index a7baca7b1d..e796e038cc 100644
--- a/store/policy.go
+++ b/store/policy.go
@@ -359,7 +359,7 @@ func (s *Store) getPolicyRaw(ctx context.Context, find *api.PolicyFind) (*policy
}
func findPolicyImpl(ctx context.Context, tx *Tx, find *api.PolicyFind) ([]*policyRaw, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
@@ -737,7 +737,7 @@ func (s *Store) UpdatePolicyV2(ctx context.Context, patch *UpdatePolicyMessage)
}
func (*Store) listPolicyImplV2(ctx context.Context, tx *Tx, find *FindPolicyMessage) ([]*PolicyMessage, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ResourceType; v != nil {
where, args = append(where, fmt.Sprintf("resource_type = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/principal.go b/store/principal.go
index 8c5848e10c..f1254f4669 100644
--- a/store/principal.go
+++ b/store/principal.go
@@ -188,7 +188,7 @@ func (s *Store) GetUserByEmail(ctx context.Context, email string) (*UserMessage,
// GetUserByEmailV2 gets an instance of Principal.
func (*Store) listUserImpl(ctx context.Context, tx *Tx, find *FindUserMessage) ([]*UserMessage, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("principal.id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/project.go b/store/project.go
index 6e2d724028..72ac45a376 100644
--- a/store/project.go
+++ b/store/project.go
@@ -427,7 +427,7 @@ func (*Store) updateProjectImplV2(ctx context.Context, tx *Tx, patch *UpdateProj
}
func (*Store) listProjectImplV2(ctx context.Context, tx *Tx, find *FindProjectMessage) ([]*ProjectMessage, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ResourceID; v != nil {
where, args = append(where, fmt.Sprintf("resource_id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/project_member.go b/store/project_member.go
index e99e7202f8..58cb1f5c4a 100644
--- a/store/project_member.go
+++ b/store/project_member.go
@@ -473,7 +473,7 @@ func createProjectMemberImpl(ctx context.Context, tx *Tx, create *api.ProjectMem
func findProjectMemberImpl(ctx context.Context, tx *Tx, find *api.ProjectMemberFind) ([]*projectMemberRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
@@ -653,7 +653,7 @@ func (s *Store) GetProjectPolicy(ctx context.Context, find *GetProjectPolicyMess
}
func (s *Store) getProjectPolicyImpl(ctx context.Context, tx *Tx, projectRoleProvider api.ProjectRoleProvider, find *GetProjectPolicyMessage) (*IAMPolicyMessage, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
where, args = append(where, fmt.Sprintf("project_member.row_status = $%d", len(args)+1)), append(args, api.Normal)
where, args = append(where, fmt.Sprintf("project_member.role_provider = $%d", len(args)+1)), append(args, projectRoleProvider)
if v := find.ProjectID; v != nil {
diff --git a/store/project_webhook.go b/store/project_webhook.go
index e34c8991de..497e2a93c7 100644
--- a/store/project_webhook.go
+++ b/store/project_webhook.go
@@ -243,7 +243,7 @@ func createProjectWebhookImpl(ctx context.Context, tx *Tx, create *api.ProjectWe
func findProjectWebhookImpl(ctx context.Context, tx *Tx, find *api.ProjectWebhookFind) ([]*projectWebhookRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/repository.go b/store/repository.go
index 0379b6e026..04ac0d8e1e 100644
--- a/store/repository.go
+++ b/store/repository.go
@@ -352,7 +352,7 @@ func (s *Store) createRepositoryImpl(ctx context.Context, tx *Tx, create *api.Re
func (*Store) findRepositoryImpl(ctx context.Context, tx *Tx, find *api.RepositoryFind) ([]*repositoryRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/setting.go b/store/setting.go
index 061efe3a13..cd1d6ee455 100644
--- a/store/setting.go
+++ b/store/setting.go
@@ -211,7 +211,7 @@ func createSettingImpl(ctx context.Context, tx *Tx, create *api.SettingCreate) (
func findSettingImpl(ctx context.Context, tx *Tx, find *api.SettingFind) ([]*settingRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.Name; v != nil {
where, args = append(where, "name = $1"), append(args, *v)
}
diff --git a/store/sheet.go b/store/sheet.go
index c5989203b6..d7c8c3e1cc 100644
--- a/store/sheet.go
+++ b/store/sheet.go
@@ -443,7 +443,7 @@ func patchSheetImpl(ctx context.Context, tx *Tx, patch *api.SheetPatch) (*sheetR
}
func findSheetImpl(ctx context.Context, tx *Tx, find *api.SheetFind) ([]*sheetRaw, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
diff --git a/store/sheet_organizer.go b/store/sheet_organizer.go
index f0e138b4db..8cf6a5322f 100644
--- a/store/sheet_organizer.go
+++ b/store/sheet_organizer.go
@@ -116,7 +116,7 @@ func upsertSheetOrganizerImpl(ctx context.Context, tx *Tx, upsert *api.SheetOrga
}
func findSheetOrganizerListImpl(ctx context.Context, tx *Tx, find *api.SheetOrganizerFind) ([]*sheetOrganizerRaw, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
where, args = append(where, fmt.Sprintf("sheet_id = $%d", len(args)+1)), append(args, find.SheetID)
where, args = append(where, fmt.Sprintf("principal_id = $%d", len(args)+1)), append(args, find.PrincipalID)
diff --git a/store/stage.go b/store/stage.go
index 12f4a147ea..551ea9bca5 100644
--- a/store/stage.go
+++ b/store/stage.go
@@ -220,7 +220,7 @@ func (*Store) createStageImpl(ctx context.Context, tx *Tx, creates []*api.StageC
func (*Store) findStageImpl(ctx context.Context, tx *Tx, find *api.StageFind) ([]*stageRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/task.go b/store/task.go
index 771829f262..f2061f082e 100644
--- a/store/task.go
+++ b/store/task.go
@@ -528,7 +528,7 @@ func (*Store) createTaskImpl(ctx context.Context, tx *Tx, creates ...*api.TaskCr
func (*Store) findTaskImpl(ctx context.Context, tx *Tx, find *api.TaskFind) ([]*taskRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/task_check_run.go b/store/task_check_run.go
index 47aa48bf8b..e154b84304 100644
--- a/store/task_check_run.go
+++ b/store/task_check_run.go
@@ -342,7 +342,7 @@ func (*Store) patchTaskCheckRunStatusImpl(ctx context.Context, tx *Tx, patch *ap
set, args = append(set, "result = $4"), append(args, patch.Result)
// Build WHERE clause.
- where := []string{"1 = 1"}
+ where := []string{"TRUE"}
if v := patch.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
@@ -398,7 +398,7 @@ func (s *Store) listTaskCheckRun(ctx context.Context, find *api.TaskCheckRunFind
func (*Store) findTaskCheckRunImpl(ctx context.Context, tx *Tx, find *api.TaskCheckRunFind) ([]*taskCheckRunRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/task_dag.go b/store/task_dag.go
index 3ed062041b..01a70062ac 100644
--- a/store/task_dag.go
+++ b/store/task_dag.go
@@ -134,7 +134,7 @@ func createTaskDAGImpl(ctx context.Context, tx *Tx, create *api.TaskDAGCreate) (
}
func findTaskDAGRawListImpl(ctx context.Context, tx *Tx, find *api.TaskDAGFind) ([]*taskDAGRaw, error) {
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.FromTaskID; v != nil {
where, args = append(where, fmt.Sprintf("from_task_id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/task_run.go b/store/task_run.go
index a0c34c4062..4cea84a26f 100644
--- a/store/task_run.go
+++ b/store/task_run.go
@@ -146,7 +146,7 @@ func (*Store) patchTaskRunStatusImpl(ctx context.Context, tx *Tx, patch *api.Tas
}
// Build WHERE clause.
- where := []string{"1 = 1"}
+ where := []string{"TRUE"}
if v := patch.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
@@ -206,7 +206,7 @@ func (s *Store) listTaskRun(ctx context.Context, find *api.TaskRunFind) ([]*task
func (*Store) findTaskRunImpl(ctx context.Context, tx *Tx, find *api.TaskRunFind) ([]*taskRunRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)
}
diff --git a/store/vcs.go b/store/vcs.go
index 3915fb7e8c..f843c80cfb 100644
--- a/store/vcs.go
+++ b/store/vcs.go
@@ -248,7 +248,7 @@ func createVCSImpl(ctx context.Context, tx *Tx, create *api.VCSCreate) (*vcsRaw,
func findVCSImpl(ctx context.Context, tx *Tx, find *api.VCSFind) ([]*vcsRaw, error) {
// Build WHERE clause.
- where, args := []string{"1 = 1"}, []interface{}{}
+ where, args := []string{"TRUE"}, []interface{}{}
if v := find.ID; v != nil {
where, args = append(where, "id = $1"), append(args, *v)
}