sql_tokenize: Tokenize SQL

View source: R/parse.R

sql_tokenizeR Documentation

Tokenize SQL

Description

Splits SQL into lexical tokens using the tokenizer of the given dialect.

Usage

sql_tokenize(sql, dialect = "generic")

Arguments

sql

A single character string with one or more SQL statements (separated by ⁠;⁠).

dialect

Dialect used for parsing.

Value

A data frame with class polyglot_tokens and one row per token: type (token type, e.g. "Select", "Identifier", "Number"), text (raw token text), line and column (1-based position), start and end (byte offsets, end exclusive).

Examples

sql_tokenize("SELECT a FROM t")

polyglotSQL documentation built on Sept. 27, 2026, 5:06 p.m.