sqlload-python-host 0.91.0

The Python host of SQLLoad's engine: runs Python tables and crosses what they yield into the engine, for a pyo3 extension of your own.
Documentation
1
2
3
4
5
6
7
8
9
10
//! How many threads parse one table's batches by default.

use crate::crossing::constants::MAX_DEFAULT_PARSE_THREADS;

/// One parser per core but one, which the generator's thread keeps, capped at the default.
pub fn default_parse_threads() -> usize {
    std::thread::available_parallelism()
        .map_or(1, |cores| cores.get().saturating_sub(1))
        .clamp(1, MAX_DEFAULT_PARSE_THREADS)
}