fingerprint

package
v1.18.0 Latest Latest
Warning

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

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

Documentation

Overview

Package fingerprint computes stable, semantic SQL fingerprints via libpg_query. The fingerprint is identical across comment/whitespace differences and literal-vs-placeholder differences. libpg_query is cgo-only, and its bundled C does not link with the TDM-GCC toolchain used for Windows container builds, so the stub in fingerprint_nocgo.go covers both the !cgo cross-compile and all Windows builds: it reports Supported() == false and returns ErrEmpty from every Fingerprint call.

This file holds the declarations shared by both builds so the two build-tagged implementations cannot drift apart.

Index

Constants

View Source
const SentinelUnparsable = "<unparsable query>"

Variables

View Source
var ErrEmpty = errors.New("fingerprint: empty query text")

Functions

func Fingerprint

func Fingerprint(query string) (string, error)

Fingerprint parses query and returns its fingerprint, falling back to a quote/paren repair pass and then to the unparsable sentinel hash.

func FingerprintOf

func FingerprintOf(text string) string

FingerprintOf hashes a known sentinel string deterministically.

func Supported

func Supported() bool

Supported reports whether SQL fingerprinting is available in this build. libpg_query requires cgo.

Types

This section is empty.

Jump to

Keyboard shortcuts

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