ident

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ident provides SQL and Cypher identifier validation.

Index

Constants

This section is empty.

Variables

View Source
var ValidIdentifierRe = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`)

ValidIdentifierRe matches safe SQL/Cypher identifiers: must start with a letter or underscore, followed by letters, digits, or underscores. This prevents injection payloads from being interpolated into DDL or Cypher statements.

Functions

func Validate

func Validate(id string) error

Validate returns an error if id is not a valid SQL identifier.

func ValidateCypher

func ValidateCypher(id, kind string) error

ValidateCypher returns an error if id is not a valid Cypher label, relationship type, or property key. kind names what is being validated (used in error messages).

Types

This section is empty.

Jump to

Keyboard shortcuts

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