Initialize initializes each package across the project. This function should be used instead of an init() function.
(dEnv *env.DoltEnv, cfg *doltgresservercfg.DoltgresConfig)
| 47 | |
| 48 | // Initialize initializes each package across the project. This function should be used instead of an init() function. |
| 49 | func Initialize(dEnv *env.DoltEnv, cfg *doltgresservercfg.DoltgresConfig) { |
| 50 | once.Do(func() { |
| 51 | core.Init() |
| 52 | rootobject.Init() |
| 53 | auth.Init(dEnv, cfg) |
| 54 | pgtypes.Init() |
| 55 | analyzer.Init() |
| 56 | config.Init() |
| 57 | binary.Init() |
| 58 | unary.Init() |
| 59 | functions.Init() |
| 60 | aggregate.Init() |
| 61 | builtInCasts := casts.Init(core.GetRunnerFromContext, func(f sql.Expression) bool { |
| 62 | if cf, ok := f.(*framework.CompiledFunction); ok { |
| 63 | return cf.IsStrict() |
| 64 | } |
| 65 | return false |
| 66 | }, &framework.FunctionProvider{}) |
| 67 | cast.Init(builtInCasts) |
| 68 | framework.Initialize(ast.Convert) |
| 69 | servercfg.DefaultUnixSocketFilePath = cfgdetails.DefaultPostgresUnixSocketFilePath |
| 70 | tables.Init() |
| 71 | pgcatalog.Init() |
| 72 | information_schema.Init() |
| 73 | dtables.Init() |
| 74 | }) |
| 75 | } |