sqlite

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package sqlite evaluates SQL snippets against an in-memory SQLite database. Migrations (*.up.sql / *.sqlite3) are applied first, then the remaining .sql files are executed; the final SELECT result is rendered as an HTML table.

The logic was moved out of the tour package so it can be reused by any code block evaluation surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasSQL

func HasSQL(files map[string]string) bool

HasSQL reports whether any file in the set is a .sql file.

Types

type Evaluator

type Evaluator struct{}

Evaluator runs SQL snippets.

func New

func New() *Evaluator

New returns a SQL evaluator.

func (*Evaluator) Eval

func (e *Evaluator) Eval(ctx context.Context, req model.Request) (model.Result, error)

Eval reads all files from req.FS and runs the SQL snippets, returning the result of the first non-empty query as an HTML table.

Jump to

Keyboard shortcuts

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