Skip to main content

parse_with_source

Function parse_with_source 

Source
pub fn parse_with_source(
    sql: &str,
) -> Result<Vec<(Statement, String)>, ParseError>
Expand description

Parse sql into statements, each paired with its EXACT source text — the byte slice of sql spanning that statement, trimmed of surrounding whitespace. The multi-range gateway uses this to forward an INDIVIDUAL statement (not the whole ;-separated simple-query frame) to a remote range’s leader, so a frame mixing a local and a remote range never re-runs the local statement on the remote node.

§Errors

Returns a parse error when the SQL text cannot be tokenized or parsed.