Function guard

Source
pub fn guard(
    depth: usize,
    limit: usize,
    source: &'static str,
) -> Result<(), SqlParseError>
Expand description

A utility for guarding against stack overflows in the SQL parser.

Usage:

use spacetimedb_sql_parser::parser::recursion;
let mut depth = 0;
assert!(recursion::guard(depth, 10, "test").is_ok());