We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent9e5e8b6 commitdcc1b72Copy full SHA for dcc1b72
pgml-extension/src/bindings/venv.rs
@@ -7,6 +7,8 @@ use pyo3::prelude::*;
7
use pyo3::types::PyTuple;
8
use std::ffi::CStr;
9
10
+staticCONFIG_NAME:&'staticstr ="pgml.venv";
11
+
12
staticPY_MODULE:Lazy<Py<PyModule>> =Lazy::new(||{
13
Python::with_gil(|py| ->Py<PyModule>{
14
let src =include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/src/bindings/venv.py"));
@@ -28,8 +30,7 @@ pub fn activate_venv(venv: &str) -> bool {
28
30
29
31
pubfnactivate() ->bool{
32
unsafe{
-let config_name ="pgml.venv".to_string();
-let option = pgrx_pg_sys::GetConfigOption(config_name.as_pg_cstr(),true,false);
33
+let option = pgrx_pg_sys::GetConfigOption(CONFIG_NAME.as_pg_cstr(),true,false);
34
if option.is_null(){
35
false
36
}else{