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

Function RunInMemory

server/server.go:73–86  ·  view source on GitHub ↗

RunInMemory starts the server based on the given args, while also using RAM as the backing store. The returned WaitGroup may be used to wait for the server to close.

(cfg *servercfg.DoltgresConfig, protocolListenerFactory server.ProtocolListenerFunc)

Source from the content-addressed store, hash-verified

71// RunInMemory starts the server based on the given args, while also using RAM as the backing store.
72// The returned WaitGroup may be used to wait for the server to close.
73func RunInMemory(cfg *servercfg.DoltgresConfig, protocolListenerFactory server.ProtocolListenerFunc) (*svcs.Controller, error) {
74 ctx := context.Background()
75 fs := filesys.EmptyInMemFS("")
76 dEnv := env.Load(ctx, env.GetCurrentUserHomeDir, fs, doltdb.InMemDoltDB, Version)
77 globalConfig, _ := dEnv.Config.GetConfig(env.GlobalConfig)
78 if globalConfig.GetStringOrDefault(config.UserNameKey, "") == "" {
79 globalConfig.SetStrings(map[string]string{
80 config.UserNameKey: DefUserName,
81 config.UserEmailKey: DefUserEmail,
82 })
83 }
84
85 return runServer(ctx, cfg, dEnv, protocolListenerFactory)
86}
87
88// runServer starts the server based on the given args, using the provided file system as the backing store.
89// The returned WaitGroup may be used to wait for the server to close.

Callers 1

NewDoltgresQueryEngineFunction · 0.92

Calls 1

runServerFunction · 0.70

Tested by 1

NewDoltgresQueryEngineFunction · 0.74