Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Remove ById suffix in the xxxService implementation.
天舟b8c980074191
diff --git a/backend/api/database.go b/backend/api/database.goindex f3cc95876e..26821f38f9 100644--- a/backend/api/database.go+++ b/backend/api/database.go@@ -103,5 +103,5 @@ type DatabaseService interface {CreateDatabase(ctx context.Context, create *DatabaseCreate) (*Database, error)FindDatabaseList(ctx context.Context, find *DatabaseFind) ([]*Database, error)FindDatabase(ctx context.Context, find *DatabaseFind) (*Database, error)- PatchDatabaseByID(ctx context.Context, patch *DatabasePatch) (*Database, error)+ PatchDatabase(ctx context.Context, patch *DatabasePatch) (*Database, error)}diff --git a/backend/api/environment.go b/backend/api/environment.goindex bf5abfd66c..d9f44797f9 100644--- a/backend/api/environment.go+++ b/backend/api/environment.go@@ -61,5 +61,5 @@ type EnvironmentService interface {CreateEnvironment(ctx context.Context, create *EnvironmentCreate) (*Environment, error)FindEnvironmentList(ctx context.Context, find *EnvironmentFind) ([]*Environment, error)FindEnvironment(ctx context.Context, find *EnvironmentFind) (*Environment, error)- PatchEnvironmentByID(ctx context.Context, patch *EnvironmentPatch) (*Environment, error)+ PatchEnvironment(ctx context.Context, patch *EnvironmentPatch) (*Environment, error)}diff --git a/backend/api/instance.go b/backend/api/instance.goindex 9a1c75d102..48e19b615a 100644--- a/backend/api/instance.go+++ b/backend/api/instance.go@@ -72,5 +72,5 @@ type InstanceService interface {CreateInstance(ctx context.Context, create *InstanceCreate) (*Instance, error)FindInstanceList(ctx context.Context, find *InstanceFind) ([]*Instance, error)FindInstance(ctx context.Context, find *InstanceFind) (*Instance, error)- PatchInstanceByID(ctx context.Context, patch *InstancePatch) (*Instance, error)+ PatchInstance(ctx context.Context, patch *InstancePatch) (*Instance, error)}diff --git a/backend/api/issue.go b/backend/api/issue.goindex 64807a14ad..93e0ce17e0 100644--- a/backend/api/issue.go+++ b/backend/api/issue.go@@ -134,5 +134,5 @@ type IssueService interface {CreateIssue(ctx context.Context, create *IssueCreate) (*Issue, error)FindIssueList(ctx context.Context, find *IssueFind) ([]*Issue, error)FindIssue(ctx context.Context, find *IssueFind) (*Issue, error)- PatchIssueByID(ctx context.Context, patch *IssuePatch) (*Issue, error)+ PatchIssue(ctx context.Context, patch *IssuePatch) (*Issue, error)}diff --git a/backend/api/member.go b/backend/api/member.goindex 64421fc528..552e09cb23 100644--- a/backend/api/member.go+++ b/backend/api/member.go@@ -82,6 +82,6 @@ type MemberService interface {CreateMember(ctx context.Context, create *MemberCreate) (*Member, error)FindMemberList(ctx context.Context, find *MemberFind) ([]*Member, error)FindMember(ctx context.Context, find *MemberFind) (*Member, error)- PatchMemberByID(ctx context.Context, patch *MemberPatch) (*Member, error)- DeleteMemberByID(ctx context.Context, delete *MemberDelete) error+ PatchMember(ctx context.Context, patch *MemberPatch) (*Member, error)+ DeleteMember(ctx context.Context, delete *MemberDelete) error}diff --git a/backend/api/pipeline.go b/backend/api/pipeline.goindex dbc682bff7..08d746fcdf 100644--- a/backend/api/pipeline.go+++ b/backend/api/pipeline.go@@ -75,5 +75,5 @@ type PipelinePatch struct {type PipelineService interface {CreatePipeline(ctx context.Context, create *PipelineCreate) (*Pipeline, error)FindPipeline(ctx context.Context, find *PipelineFind) (*Pipeline, error)- PatchPipelineByID(ctx context.Context, patch *PipelinePatch) (*Pipeline, error)+ PatchPipeline(ctx context.Context, patch *PipelinePatch) (*Pipeline, error)}diff --git a/backend/api/principal.go b/backend/api/principal.goindex ef71ad7744..d928782bd5 100644--- a/backend/api/principal.go+++ b/backend/api/principal.go@@ -95,5 +95,5 @@ type PrincipalService interface {CreatePrincipal(ctx context.Context, create *PrincipalCreate) (*Principal, error)FindPrincipalList(ctx context.Context, find *PrincipalFind) ([]*Principal, error)FindPrincipal(ctx context.Context, find *PrincipalFind) (*Principal, error)- PatchPrincipalByID(ctx context.Context, patch *PrincipalPatch) (*Principal, error)+ PatchPrincipal(ctx context.Context, patch *PrincipalPatch) (*Principal, error)}diff --git a/backend/api/project.go b/backend/api/project.goindex 69efe460d2..5c27d52813 100644--- a/backend/api/project.go+++ b/backend/api/project.go@@ -57,5 +57,5 @@ type ProjectService interface {CreateProject(ctx context.Context, create *ProjectCreate) (*Project, error)FindProjectList(ctx context.Context, find *ProjectFind) ([]*Project, error)FindProject(ctx context.Context, find *ProjectFind) (*Project, error)- PatchProjectByID(ctx context.Context, patch *ProjectPatch) (*Project, error)+ PatchProject(ctx context.Context, patch *ProjectPatch) (*Project, error)}diff --git a/backend/api/projectMember.go b/backend/api/projectMember.goindex be812db768..df84588061 100644--- a/backend/api/projectMember.go+++ b/backend/api/projectMember.go@@ -84,6 +84,6 @@ type ProjectMemberDelete struct {type ProjectMemberService interface {CreateProjectMember(ctx context.Context, create *ProjectMemberCreate) (*ProjectMember, error)FindProjectMemberList(ctx context.Context, find *ProjectMemberFind) ([]*ProjectMember, error)- PatchProjectMemberByID(ctx context.Context, patch *ProjectMemberPatch) (*ProjectMember, error)- DeleteProjectMemberByID(ctx context.Context, delete *ProjectMemberDelete) error+ PatchProjectMember(ctx context.Context, patch *ProjectMemberPatch) (*ProjectMember, error)+ DeleteProjectMember(ctx context.Context, delete *ProjectMemberDelete) error}diff --git a/backend/api/task.go b/backend/api/task.goindex ed81f0f91b..8979bb2555 100644--- a/backend/api/task.go+++ b/backend/api/task.go@@ -118,5 +118,5 @@ type TaskService interface {CreateTask(ctx context.Context, create *TaskCreate) (*Task, error)FindTaskList(ctx context.Context, find *TaskFind) ([]*Task, error)FindTask(ctx context.Context, find *TaskFind) (*Task, error)- PatchTaskByID(ctx context.Context, patch *TaskPatch) (*Task, error)+ PatchTask(ctx context.Context, patch *TaskPatch) (*Task, error)}diff --git a/backend/server/database.go b/backend/server/database.goindex 2747c503fb..6f7b59635f 100644--- a/backend/server/database.go+++ b/backend/server/database.go@@ -104,7 +104,7 @@ func (s *Server) registerDatabaseRoutes(g *echo.Group) {return echo.NewHTTPError(http.StatusBadRequest, "Malformatted patch database request").SetInternal(err)}- database, err := s.DatabaseService.PatchDatabaseByID(context.Background(), databasePatch)+ database, err := s.DatabaseService.PatchDatabase(context.Background(), databasePatch)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Database ID not found: %d", id))diff --git a/backend/server/environment.go b/backend/server/environment.goindex f845784082..53f506292e 100644--- a/backend/server/environment.go+++ b/backend/server/environment.go@@ -69,7 +69,7 @@ func (s *Server) registerEnvironmentRoutes(g *echo.Group) {return echo.NewHTTPError(http.StatusBadRequest, "Malformatted patch environment request").SetInternal(err)}- environment, err := s.EnvironmentService.PatchEnvironmentByID(context.Background(), environmentPatch)+ environment, err := s.EnvironmentService.PatchEnvironment(context.Background(), environmentPatch)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Environment ID not found: %d", id))@@ -94,7 +94,7 @@ func (s *Server) registerEnvironmentRoutes(g *echo.Group) {environmentPatch, _ := item.(*api.EnvironmentPatch)environmentPatch.WorkspaceId = api.DEFAULT_WORKPSACE_IDenvironmentPatch.UpdaterId = c.Get(GetPrincipalIdContextKey()).(int)- _, err = s.EnvironmentService.PatchEnvironmentByID(context.Background(), environmentPatch)+ _, err = s.EnvironmentService.PatchEnvironment(context.Background(), environmentPatch)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Environment ID not found: %d", environmentPatch.ID))diff --git a/backend/server/instance.go b/backend/server/instance.goindex ee443e9401..4f3f4bcfae 100644--- a/backend/server/instance.go+++ b/backend/server/instance.go@@ -99,7 +99,7 @@ func (s *Server) registerInstanceRoutes(g *echo.Group) {var instance *api.Instanceif instancePatch.RowStatus != nil || instancePatch.Name != nil || instancePatch.ExternalLink != nil || instancePatch.Host != nil || instancePatch.Port != nil {- instance, err = s.InstanceService.PatchInstanceByID(context.Background(), instancePatch)+ instance, err = s.InstanceService.PatchInstance(context.Background(), instancePatch)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Instance ID not found: %d", id))diff --git a/backend/server/issue.go b/backend/server/issue.goindex 768c91b659..77ffcec909 100644--- a/backend/server/issue.go+++ b/backend/server/issue.go@@ -97,7 +97,7 @@ func (s *Server) registerIssueRoutes(g *echo.Group) {return echo.NewHTTPError(http.StatusBadRequest, "Malformatted patch issue request").SetInternal(err)}- issue, err := s.IssueService.PatchIssueByID(context.Background(), issuePatch)+ issue, err := s.IssueService.PatchIssue(context.Background(), issuePatch)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Issue ID not found: %d", id))diff --git a/backend/server/member.go b/backend/server/member.goindex a7353aa1d7..f64debe4a6 100644--- a/backend/server/member.go+++ b/backend/server/member.go@@ -68,7 +68,7 @@ func (s *Server) registerMemberRoutes(g *echo.Group) {return echo.NewHTTPError(http.StatusBadRequest, "Malformatted patch member request").SetInternal(err)}- member, err := s.MemberService.PatchMemberByID(context.Background(), memberPatch)+ member, err := s.MemberService.PatchMember(context.Background(), memberPatch)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Member ID not found: %d", id))@@ -93,7 +93,7 @@ func (s *Server) registerMemberRoutes(g *echo.Group) {ID: id,DeleterId: c.Get(GetPrincipalIdContextKey()).(int),}- err = s.MemberService.DeleteMemberByID(context.Background(), memberDelete)+ err = s.MemberService.DeleteMember(context.Background(), memberDelete)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Member ID not found: %d", id))diff --git a/backend/server/principal.go b/backend/server/principal.goindex 1a89b742fd..76194697fc 100644--- a/backend/server/principal.go+++ b/backend/server/principal.go@@ -83,7 +83,7 @@ func (s *Server) registerPrincipalRoutes(g *echo.Group) {return echo.NewHTTPError(http.StatusBadRequest, "Malformatted patch principal request").SetInternal(err)}- principal, err := s.PrincipalService.PatchPrincipalByID(context.Background(), principalPatch)+ principal, err := s.PrincipalService.PatchPrincipal(context.Background(), principalPatch)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("User ID not found: %d", id))diff --git a/backend/server/project.go b/backend/server/project.goindex db36d9dd13..ec90e63816 100644--- a/backend/server/project.go+++ b/backend/server/project.go@@ -95,7 +95,7 @@ func (s *Server) registerProjectRoutes(g *echo.Group) {return echo.NewHTTPError(http.StatusBadRequest, "Malformatted patch project request").SetInternal(err)}- project, err := s.ProjectService.PatchProjectByID(context.Background(), projectPatch)+ project, err := s.ProjectService.PatchProject(context.Background(), projectPatch)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Project ID not found: %d", id))diff --git a/backend/server/projectMember.go b/backend/server/projectMember.goindex 39d3a7263b..8975f4a37e 100644--- a/backend/server/projectMember.go+++ b/backend/server/projectMember.go@@ -63,7 +63,7 @@ func (s *Server) registerProjectMemberRoutes(g *echo.Group) {return echo.NewHTTPError(http.StatusBadRequest, "Malformatted change project membership").SetInternal(err)}- projectMember, err := s.ProjectMemberService.PatchProjectMemberByID(context.Background(), projectMemberPatch)+ projectMember, err := s.ProjectMemberService.PatchProjectMember(context.Background(), projectMemberPatch)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Project member ID not found: %d", id))@@ -93,7 +93,7 @@ func (s *Server) registerProjectMemberRoutes(g *echo.Group) {ID: id,DeleterId: c.Get(GetPrincipalIdContextKey()).(int),}- err = s.ProjectMemberService.DeleteProjectMemberByID(context.Background(), projectMemberDelete)+ err = s.ProjectMemberService.DeleteProjectMember(context.Background(), projectMemberDelete)if err != nil {if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Project member ID not found: %d", id))diff --git a/backend/store/database.go b/backend/store/database.goindex 75475574c8..0512de0c81 100644--- a/backend/store/database.go+++ b/backend/store/database.go@@ -81,9 +81,9 @@ func (s *DatabaseService) FindDatabase(ctx context.Context, find *api.DatabaseFireturn list[0], nil}-// PatchDatabaseByID updates an existing database by ID.+// PatchDatabase updates an existing database by ID.// Returns ENOTFOUND if database does not exist.-func (s *DatabaseService) PatchDatabaseByID(ctx context.Context, patch *api.DatabasePatch) (*api.Database, error) {+func (s *DatabaseService) PatchDatabase(ctx context.Context, patch *api.DatabasePatch) (*api.Database, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)diff --git a/backend/store/environment.go b/backend/store/environment.goindex 45d4e68950..e239e2f798 100644--- a/backend/store/environment.go+++ b/backend/store/environment.go@@ -81,9 +81,9 @@ func (s *EnvironmentService) FindEnvironment(ctx context.Context, find *api.Envireturn list[0], nil}-// PatchEnvironmentByID updates an existing environment by ID.+// PatchEnvironment updates an existing environment by ID.// Returns ENOTFOUND if environment does not exist.-func (s *EnvironmentService) PatchEnvironmentByID(ctx context.Context, patch *api.EnvironmentPatch) (*api.Environment, error) {+func (s *EnvironmentService) PatchEnvironment(ctx context.Context, patch *api.EnvironmentPatch) (*api.Environment, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)diff --git a/backend/store/instance.go b/backend/store/instance.goindex a00d792893..f947968f86 100644--- a/backend/store/instance.go+++ b/backend/store/instance.go@@ -81,9 +81,9 @@ func (s *InstanceService) FindInstance(ctx context.Context, find *api.InstanceFireturn list[0], nil}-// PatchInstanceByID updates an existing instance by ID.+// PatchInstance updates an existing instance by ID.// Returns ENOTFOUND if instance does not exist.-func (s *InstanceService) PatchInstanceByID(ctx context.Context, patch *api.InstancePatch) (*api.Instance, error) {+func (s *InstanceService) PatchInstance(ctx context.Context, patch *api.InstancePatch) (*api.Instance, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)diff --git a/backend/store/issue.go b/backend/store/issue.goindex d1557b6776..01e5dafa12 100644--- a/backend/store/issue.go+++ b/backend/store/issue.go@@ -82,9 +82,9 @@ func (s *IssueService) FindIssue(ctx context.Context, find *api.IssueFind) (*apireturn list[0], nil}-// PatchIssueByID updates an existing issue by ID.+// PatchIssue updates an existing issue by ID.// Returns ENOTFOUND if issue does not exist.-func (s *IssueService) PatchIssueByID(ctx context.Context, patch *api.IssuePatch) (*api.Issue, error) {+func (s *IssueService) PatchIssue(ctx context.Context, patch *api.IssuePatch) (*api.Issue, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)diff --git a/backend/store/member.go b/backend/store/member.goindex 05c979f554..df0523d61c 100644--- a/backend/store/member.go+++ b/backend/store/member.go@@ -81,9 +81,9 @@ func (s *MemberService) FindMember(ctx context.Context, find *api.MemberFind) (*return list[0], nil}-// PatchMemberByID updates an existing member by ID.+// PatchMember updates an existing member by ID.// Returns ENOTFOUND if member does not exist.-func (s *MemberService) PatchMemberByID(ctx context.Context, patch *api.MemberPatch) (*api.Member, error) {+func (s *MemberService) PatchMember(ctx context.Context, patch *api.MemberPatch) (*api.Member, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)@@ -102,9 +102,9 @@ func (s *MemberService) PatchMemberByID(ctx context.Context, patch *api.MemberPareturn member, nil}-// DeleteMemberByID deletes an existing member by ID.+// DeleteMember deletes an existing member by ID.// Returns ENOTFOUND if member does not exist.-func (s *MemberService) DeleteMemberByID(ctx context.Context, delete *api.MemberDelete) error {+func (s *MemberService) DeleteMember(ctx context.Context, delete *api.MemberDelete) error {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return FormatError(err)diff --git a/backend/store/pipeline.go b/backend/store/pipeline.goindex f97b7f2d3e..77925d1ae3 100644--- a/backend/store/pipeline.go+++ b/backend/store/pipeline.go@@ -65,9 +65,9 @@ func (s *PipelineService) FindPipeline(ctx context.Context, find *api.PipelineFireturn list[0], nil}-// PatchPipelineByID updates an existing pipeline by ID.+// PatchPipeline updates an existing pipeline by ID.// Returns ENOTFOUND if pipeline does not exist.-func (s *PipelineService) PatchPipelineByID(ctx context.Context, patch *api.PipelinePatch) (*api.Pipeline, error) {+func (s *PipelineService) PatchPipeline(ctx context.Context, patch *api.PipelinePatch) (*api.Pipeline, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)diff --git a/backend/store/principal.go b/backend/store/principal.goindex 0f4258b59b..d50b204606 100644--- a/backend/store/principal.go+++ b/backend/store/principal.go@@ -81,9 +81,9 @@ func (s *PrincipalService) FindPrincipal(ctx context.Context, find *api.Principareturn list[0], nil}-// PatchPrincipalByID updates an existing principal by ID.+// PatchPrincipal updates an existing principal by ID.// Returns ENOTFOUND if principal does not exist.-func (s *PrincipalService) PatchPrincipalByID(ctx context.Context, patch *api.PrincipalPatch) (*api.Principal, error) {+func (s *PrincipalService) PatchPrincipal(ctx context.Context, patch *api.PrincipalPatch) (*api.Principal, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)diff --git a/backend/store/project.go b/backend/store/project.goindex 5b72f642dc..759b13cd7f 100644--- a/backend/store/project.go+++ b/backend/store/project.go@@ -81,9 +81,9 @@ func (s *ProjectService) FindProject(ctx context.Context, find *api.ProjectFind)return list[0], nil}-// PatchProjectByID updates an existing project by ID.+// PatchProject updates an existing project by ID.// Returns ENOTFOUND if project does not exist.-func (s *ProjectService) PatchProjectByID(ctx context.Context, patch *api.ProjectPatch) (*api.Project, error) {+func (s *ProjectService) PatchProject(ctx context.Context, patch *api.ProjectPatch) (*api.Project, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)diff --git a/backend/store/projectMember.go b/backend/store/projectMember.goindex a1a59436eb..1f5c306054 100644--- a/backend/store/projectMember.go+++ b/backend/store/projectMember.go@@ -81,9 +81,9 @@ func (s *ProjectMemberService) FindProjectMember(ctx context.Context, find *api.return list[0], nil}-// PatchProjectMemberByID updates an existing projectMember by ID.+// PatchProjectMember updates an existing projectMember by ID.// Returns ENOTFOUND if projectMember does not exist.-func (s *ProjectMemberService) PatchProjectMemberByID(ctx context.Context, patch *api.ProjectMemberPatch) (*api.ProjectMember, error) {+func (s *ProjectMemberService) PatchProjectMember(ctx context.Context, patch *api.ProjectMemberPatch) (*api.ProjectMember, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)@@ -102,9 +102,9 @@ func (s *ProjectMemberService) PatchProjectMemberByID(ctx context.Context, patchreturn projectMember, nil}-// DeleteProjectMemberByID deletes an existing projectMember by ID.+// DeleteProjectMember deletes an existing projectMember by ID.// Returns ENOTFOUND if projectMember does not exist.-func (s *ProjectMemberService) DeleteProjectMemberByID(ctx context.Context, delete *api.ProjectMemberDelete) error {+func (s *ProjectMemberService) DeleteProjectMember(ctx context.Context, delete *api.ProjectMemberDelete) error {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return FormatError(err)diff --git a/backend/store/task.go b/backend/store/task.goindex 8cfde145eb..1a3fb94ddf 100644--- a/backend/store/task.go+++ b/backend/store/task.go@@ -81,9 +81,9 @@ func (s *TaskService) FindTask(ctx context.Context, find *api.TaskFind) (*api.Tareturn list[0], nil}-// PatchTaskByID updates an existing task by ID.+// PatchTask updates an existing task by ID.// Returns ENOTFOUND if task does not exist.-func (s *TaskService) PatchTaskByID(ctx context.Context, patch *api.TaskPatch) (*api.Task, error) {+func (s *TaskService) PatchTask(ctx context.Context, patch *api.TaskPatch) (*api.Task, error) {tx, err := s.db.BeginTx(ctx, nil)if err != nil {return nil, FormatError(err)