SQL Tokenizer v2

Examples:

Transform:

API Documentation

From your editors, initialize the tokenizer like this:

var t = new SqlTokenizer(sql);

Then call any of these methods — no need to touch .sqlTokenized or know internal token positions:

Every method that returns per-statement data accepts an optional {statement: n} parameter to filter the results to just one statement. All return shapes are flat objects with string/array fields — no internal token positions are leaked through the API.