parser

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package parser provides functions to load and parse SQLite schemas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseFS added in v0.1.5

func BaseFS() fs.FS

BaseFS returns the filesystem used for reading schema files. It returns nil when reading from the OS filesystem.

func FromDB added in v0.1.4

func FromDB(ctx context.Context, db *sql.DB) (*schema.Database, error)

FromDB extracts the schema from an open database connection.

func FromSQL

func FromSQL(ctx context.Context, sqlContent string) (*schema.Database, error)

FromSQL parses SQL by executing it against an in-memory SQLite database.

func ReadFiles added in v0.1.5

func ReadFiles(ctx context.Context, dir string) (*schema.Database, error)

ReadFiles parses all .sql files in a directory into a schema.

func SetBaseFS added in v0.1.5

func SetBaseFS(fsys fs.FS)

SetBaseFS sets the base filesystem for reading schema files. Use an embed.FS to read from embedded files. Pass nil to revert to the OS filesystem.

Types

This section is empty.

Jump to

Keyboard shortcuts

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