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

Function getDefaultDatabaseName

server/server.go:221–227  ·  view source on GitHub ↗

getDefaultDatabaseName returns the name of the default database to create on first server start. If the environment variable DOLTGRES_DB is set, that value is used. Otherwise, the username is used. The username is in turn configured with the environment variable DOLTGRES_USER, defaulting to "postgre

(userName string)

Source from the content-addressed store, hash-verified

219// If the environment variable DOLTGRES_DB is set, that value is used. Otherwise, the username is used.
220// The username is in turn configured with the environment variable DOLTGRES_USER, defaulting to "postgres".
221func getDefaultDatabaseName(userName string) string {
222 defaultDbName := os.Getenv(DefaultDbNameEnvVar)
223 if defaultDbName != "" {
224 return defaultDbName
225 }
226 return userName
227}
228
229// startReplication begins the background thread that replicates from Postgres, if one is configured.
230func startReplication(cfg *servercfg.DoltgresConfig, ssCfg doltservercfg.ServerConfig) (*logrepl.LogicalReplicator, error) {

Callers 1

createDefaultDatabaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected