Skip to main content

sqlload_python_host/host/main/
module_host.rs

1//! A host whose Python side is a module of the host's own.
2
3use std::sync::Arc;
4
5use sqlload::python_sources::types::PythonHost;
6
7use crate::host::models::ModuleHost;
8
9/// A [`PythonHost`] that calls `runtime`, a Python module the host provides (see [`ModuleHost`] for what it defines), and `sqlload_api._host` for transforms.
10pub fn module_host(runtime: &str) -> Arc<dyn PythonHost> {
11    Arc::new(ModuleHost {
12        runtime: runtime.to_owned(),
13    })
14}