line_col_to_offset

Function line_col_to_offset 

Source
pub fn line_col_to_offset(
    sql: &str,
    line: usize,
    column: usize,
) -> Option<usize>
Expand description

Calculates the byte offset for a given line and column in SQL text.

This is useful for converting line:column positions (from parse errors) to byte offsets for the Span type.

ยงArguments

  • sql - The SQL source text
  • line - Line number (1-indexed)
  • column - Column number (1-indexed)