SQLite SQL parser that converts raw SQL into AST nodes with comment handling.
// Source: https://github.com/sqlc-dev/sqlc | License: MIT | Copyright 2024 Riza, Inc
// Provided via justclaw.it.com; keep this notice with the code.
package sqlite
import (
"errors"
"io"
"strings"
meyer "github.com/sqlc-dev/meyer/ast"
"github.com/sqlc-dev/meyer/parser"
mtoken "github.com/sqlc-dev/meyer/token"
"github.com/sqlc-dev/sqlc/internal/source"
"github.com/sqlc-dev/sqlc/internal/sql/ast"
"github.com/sqlc-dev/sqlc/internal/sql/sqlerr"
)
func NewParser() *Parser {
return &Parser{}
}
type Parser struct {
}
// parseOptions accepts ORDER BY and LIMIT on UPDATE and DELETE. SQLite has
// them only when built with SQLITE_ENABLE_UPDATE_DELETE_LIMIT, which meyer
// cannot tell from the SQL, so the caller has to ask. sqlc has always
// accepted them.
var parseOptions = parser
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key