sqlhint

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package sqlhint is the shared SQL-error help used by gadak sql and gadak_query (MCP), and the owner of SQL comment stripping (StripComments) used by the group-query and MCP SELECT gates. Status, issue type, and priority names are localized per account; filtering on the display column is the locale trap that returns zero rows silently. A "no such column" error also gets a did-you-mean when the unknown name is close to a real column (GDK-255: issue_key → key).

Index

Constants

View Source
const ZeroRowWarning = "" /* 136-byte string literal not displayed */

ZeroRowWarning is the sentence both surfaces print when a query compared a display-name column and returned nothing.

Variables

This section is empty.

Functions

func FirstKeyword

func FirstKeyword(s string) string

FirstKeyword returns the leading ASCII identifier of s after skipping leading space. Strip comments first (StripComments); this does not.

func StripComments

func StripComments(s string) string

StripComments removes -- line comments and /* */ block comments outside of string literals and double-quoted identifiers. A block comment is replaced with a space so "SELECT/*x*/1" stays two tokens.

func WithColumnSuggestion

func WithColumnSuggestion(db *sql.DB, err error) error

WithColumnSuggestion appends `did you mean "col"?` to a SQLite "no such column" error when one column from hintTables is close enough. Distant names stay unadorned — a bad guess is worse than none.

func ZeroRowDisplayNameWarning

func ZeroRowDisplayNameWarning(query string, rowCount int) string

ZeroRowDisplayNameWarning returns ZeroRowWarning when rowCount is 0 and query compares a localized display-name column. Comments are stripped first so a commented example is not a filter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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