ended3월 21일· 1 sources

Building a SQL Tokenizer and Formatter From Scratch — Supporting 6 Dialects

SQL 토크나이저와 포매터를 처음부터 구축하기 — 6가지 방언(Dialect) 지원

Why it matters

The article describes building a SQL tokenizer and formatter from scratch that supports six SQL dialects (PostgreSQL, MySQL, SQL Server, Oracle, SQLite, BigQuery). It uses a two-stage architecture—a single-pass character-by-character tokenizer followed by a state machine formatter—without requiring an AST. Key challenges include handling four different quoting styles, disambiguating wildcards from multiplication operators using context, and detecting compound keywords like ORDER BY through lookahead.

1
Sources
+0
24h
Growth
178d
Active
SQL TokenizerState MachineDialectDevPrixCompound KeywordsWildcard

Sources

Related Issues