MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / preload_extension_module_from_paths

Method preload_extension_module_from_paths

src/pglite/postgres_mod.rs:1117–1149  ·  view source on GitHub ↗
(
        paths: &PglitePaths,
        extension: Extension,
    )

Source from the content-addressed store, hash-verified

1115
1116 #[cfg(feature = "extensions")]
1117 pub(crate) fn preload_extension_module_from_paths(
1118 paths: &PglitePaths,
1119 extension: Extension,
1120 ) -> Result<()> {
1121 let Some(module_file) = extension.native_module_file() else {
1122 return Ok(());
1123 };
1124 let Some(aot_name) = extension.aot_name() else {
1125 return Ok(());
1126 };
1127 let runtime_root = paths.runtime_root();
1128 let library = runtime_root
1129 .join("lib")
1130 .join("postgresql")
1131 .join(module_file);
1132 ensure!(
1133 library.exists(),
1134 "extension library for '{}' is not installed at {}",
1135 extension.sql_name(),
1136 library.display()
1137 );
1138
1139 let (engine, _) = aot::load_runtime_module()?;
1140 let process_runtime = process_wasix_runtime(&engine)?;
1141 seed_side_module_cache(
1142 &process_runtime.tokio_runtime,
1143 &engine,
1144 &process_runtime.wasix_module_cache,
1145 &library,
1146 aot_name,
1147 &format!("extension '{}'", extension.sql_name()),
1148 )
1149 }
1150
1151 pub(crate) fn run_split_initdb(
1152 paths: &PglitePaths,

Callers

nothing calls this directly

Calls 7

load_runtime_moduleFunction · 0.85
process_wasix_runtimeFunction · 0.85
seed_side_module_cacheFunction · 0.85
native_module_fileMethod · 0.80
aot_nameMethod · 0.80
runtime_rootMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected