github.com/mitranim/sqlp (go): Parser and formatter for rewriting foreign code embedded in SQL queries, such as parameter placeholders: `$1` or `:ident`, or code encased in delimiters: `()` `[]` `{}`. It supports the following SQL features:  • ” : single quotes.  • "" : double quotes.  • “ : grave quotes (non-standard).  • -- : line comments.  • /* : block comments.  • :: : Postgres-style cast operator (non-standard).  In addition, it supports the following:  • ()          : content in parens.  • []          : content in brackets.  • {}          : content in braces.  • $1 $2 ...   : ordinal parameter placeholders.  • :identifier : named parameter placeholders.  Supporting SQL quotes and comments allows us to correctly ignore text inside special delimiters that happens to be part of a string, quoted identifier, or comment.  This library supports incremental parsing token by token, via `Tokenizer`. It also lets you convert a sequence of tokens into a fully-built AST via `Parser`. Choose the approach that better suits your use case.  Oversimplified example:  The AST now looks like this:
Keywords: go|parser|sql