mool 0.2.0

A source-first Rust database toolkit for typed SQL queries, migrations, and model metadata
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

pub(super) fn collect_parts(sql: &str) -> Vec<PlaceholderPart<'_>> {
    PlaceholderIter::new(sql).collect()
}

pub(super) fn parts_to_strings(parts: Vec<PlaceholderPart>) -> Vec<String> {
    parts
        .into_iter()
        .map(|p| match p {
            PlaceholderPart::Sql(s) => format!("SQL:{}", s),
            PlaceholderPart::Placeholder(n) => format!("PARAM:{}", n),
        })
        .collect()
}

mod iter;
mod resolve;