MCPcopy Create free account
hub / github.com/dolthub/doltgresql / dbInitDefault

Function dbInitDefault

server/auth/database.go:177–194  ·  view source on GitHub ↗

dbInitDefault initializes the database and fills it with default users for testing.

()

Source from the content-addressed store, hash-verified

175
176// dbInitDefault initializes the database and fills it with default users for testing.
177func dbInitDefault() {
178 user, password := GetSuperUserAndPassword()
179
180 public := CreateDefaultRole("public")
181 SetRole(public)
182 superUser := CreateDefaultRole(user)
183 superUser.IsSuperUser = true
184 superUser.CanCreateRoles = true
185 superUser.CanCreateDB = true
186 superUser.CanLogin = true
187
188 var err error
189 superUser.Password, err = NewScramSha256Password(password)
190 if err != nil {
191 panic(err)
192 }
193 SetRole(superUser)
194}
195
196// dbInitCreateAuthDirectory creates the directory structure pointed to by the auth file if it does not already exist.
197func dbInitCreateAuthDirectory(authFileName string) error {

Callers 2

ClearDatabaseFunction · 0.85
dbInitFunction · 0.85

Calls 4

GetSuperUserAndPasswordFunction · 0.85
CreateDefaultRoleFunction · 0.85
NewScramSha256PasswordFunction · 0.85
SetRoleFunction · 0.70

Tested by

no test coverage detected