Help us shape the future of Go! Take the 2026 Go Developer Survey

readonly

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package readonly decides, from the text of a statement alone, whether a query only reads. It is the first of two guards: it gives a clear message before anything is sent, and the second is the read-only transaction the store itself enforces. It knows nothing of any driver, so the validator can use it without pulling the drivers in.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyStatement = errors.New("the query is empty")
	ErrManyStatements = errors.New("the query has more than one statement")
	ErrNotReadOnly    = errors.New("the query is not read-only")
)

The reasons Check refuses a statement.

Functions

func Check

func Check(statement string) error

Check refuses a statement that is empty, has more than one statement, or does not start like a read. A WITH that deletes passes it and is stopped by the read-only transaction every source opens.

Types

This section is empty.

Jump to

Keyboard shortcuts

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