sqlhint

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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. When the name exists verbatim on a hint table, the query hit the wrong table — say which one holds it (GDK-974: summary lives on issues_full, and the miss was silent). 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