MCPcopy Create free account
hub / github.com/PRQL/prql / rq_to_sql

Function rq_to_sql

prqlc/bindings/prqlc-python/src/lib.rs:44–56  ·  view source on GitHub ↗
(rq_json: &str, options: Option<CompileOptions>)

Source from the content-addressed store, hash-verified

42#[pyfunction]
43#[pyo3(signature = (rq_json, options=None))]
44pub fn rq_to_sql(rq_json: &str, options: Option<CompileOptions>) -> PyResult<String> {
45 prqlc_lib::json::to_rq(rq_json)
46 .and_then(|x| {
47 prqlc_lib::rq_to_sql(
48 x,
49 &options
50 .map(convert_options)
51 .transpose()?
52 .unwrap_or_default(),
53 )
54 })
55 .map_err(|err| PyErr::new::<exceptions::PyValueError, _>(err.to_json()))
56}
57
58mod debug {
59 use super::*;

Callers

nothing calls this directly

Calls 3

to_rqFunction · 0.85
mapMethod · 0.80
to_jsonMethod · 0.80

Tested by

no test coverage detected