sqlite

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package sqlite provides a SQLite dialect parser using rqlite/sql.

Package sqlite implements the parser.Parser interface for SQLite DDL using rqlite/sql (pure Go, no CGO).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseViewSQL

func ParseViewSQL(sql []byte) (parser.ViewSQL, error)

ParseViewSQL parses a CREATE VIEW statement using rqlite/sql and extracts the view name, SELECT column metadata, and FROM clause table aliases.

func QualifyFilterIdentifiers

func QualifyFilterIdentifiers(expr, alias string) (string, error)

QualifyFilterIdentifiers rewrites every bare column reference inside expr to be qualified with alias. Already-qualified refs (table.column) are left untouched. The expression is parsed via rqlite/sql and re-emitted via the AST node's String() method, so quoted identifiers, SQLite operators (GLOB, REGEXP, ->, ->>), and string-literal contents are all handled by the upstream parser.

It performs the codegen-time qualification of sub-categorized o2o `filter:` predicates.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser implements the parser.Parser interface for SQLite DDL. It uses rqlite/sql (pure Go) to parse SQLite SQL statements.

func New

func New() *Parser

New creates a new SQLite parser.

func (*Parser) Parse

func (p *Parser) Parse(filename string, sql []byte) error

Parse parses SQLite DDL from sql. It can be called multiple times with different files; results accumulate.

func (*Parser) Schema

func (p *Parser) Schema() *parser.Schema

Schema returns the accumulated schema model.

func (*Parser) Seed

func (p *Parser) Seed(base *parser.Schema)

Seed pre-populates the parser with an existing schema. This enables "both" mode where introspected tables are loaded before file-based DDL is applied.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL