SetDialect reconfigures the tokenizer for a different SQL dialect. This rebuilds the keyword set to include dialect-specific keywords.
(dialect keywords.SQLDialect)
| 325 | // SetDialect reconfigures the tokenizer for a different SQL dialect. |
| 326 | // This rebuilds the keyword set to include dialect-specific keywords. |
| 327 | func (t *Tokenizer) SetDialect(dialect keywords.SQLDialect) { |
| 328 | if dialect == "" || dialect == keywords.DialectUnknown { |
| 329 | dialect = keywords.DialectPostgreSQL |
| 330 | } |
| 331 | t.dialect = dialect |
| 332 | t.keywords = keywords.New(dialect, true) |
| 333 | } |
| 334 | |
| 335 | // NewWithKeywords initializes a Tokenizer with a custom keyword classifier. |
| 336 | // This allows you to customize keyword recognition for specific SQL dialects |