sqlmask

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Overview

Package sqlmask hides the text of database/sql conversion failures. It imports only momo and the standard library, so every adapter that scans through database/sql can use it without linking another driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConversionErr

func ConversionErr(c error, msg string, isDriverErr func(error) bool) error

ConversionErr hides the text of a database/sql conversion failure: database/sql quotes the stored value in it ("converting driver.Value type string ("...")"). c must already be classified by the driver. Only errors that look like a conversion failure are masked; cancellation, a closed Rows, a *momo.Error and errors for which isDriverErr reports true pass through. The cause stays reachable through errors.Unwrap, as with pgxdriver data exceptions. msg is the fixed text of the masked error.

Types

type Error

type Error struct {
	Cause error
	Msg   string
}

Error carries a conversion failure while exposing only a fixed message. The cause stays reachable through errors.Unwrap.

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

Jump to

Keyboard shortcuts

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