MCPcopy Create free account
hub / github.com/PostHog/duckgres / UpdateOrg

Method UpdateOrg

controlplane/admin/api_test.go:61–83  ·  view source on GitHub ↗
(name string, updates configstore.Org)

Source from the content-addressed store, hash-verified

59 if t.SchemaName == schemaName {
60 return configstore.ErrOrgTeamSchemaConflict
61 }
62 }
63 clone := copyOrg(org)
64 clone.Warehouse = nil
65 s.orgs[org.Name] = clone
66 s.seedTeam(configstore.OrgTeam{OrgID: org.Name, TeamID: teamID, SchemaName: schemaName, Enabled: true})
67 return nil
68}
69
70func (s *fakeAPIStore) GetOrg(name string) (*configstore.Org, error) {
71 org, ok := s.orgs[name]
72 if !ok {
73 return nil, gorm.ErrRecordNotFound
74 }
75 return copyOrg(org), nil
76}
77
78func (s *fakeAPIStore) UpdateOrg(name string, updates configstore.Org) (*configstore.Org, bool, error) {
79 org, ok := s.orgs[name]
80 if !ok {
81 return nil, false, nil
82 }
83 org.MaxWorkers = updates.MaxWorkers
84 org.MaxVCPUs = updates.MaxVCPUs
85 // Mirrors gormAPIStore: "" = preserve, non-empty renames.
86 if updates.DatabaseName != "" {

Callers

nothing calls this directly

Calls 1

copyOrgFunction · 0.85

Tested by

no test coverage detected