1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! SQL placeholder generation and caching.
/// Maximum batch size that is pre-built and cached at startup.
/// All observed batch sizes (55, 100, 190, 200, 250, 300, 500, 900) fall within this range.
const PLACEHOLDER_CACHE_MAX: usize = 999;
/// Pre-built placeholder strings for n = 1..=PLACEHOLDER_CACHE_MAX.
/// Index 0 is unused; index n holds the string for n placeholders.
static PLACEHOLDER_CACHE: LazyLock = new;
/// Build a placeholder string without caching (used by both cache init and large n).
/// Build a comma-separated list of numbered SQL placeholders: "?1,?2,...,?N".
///
/// Common batch sizes (1-999) are served from a static cache; larger values are built on demand.
pub