Documentation
¶
Overview ¶
Package identsafe centralises the SQL identifier (field name) validation shared by every dialect.
Each dialect previously reimplemented the same validateFieldName skeleton — empty check, optional length cap, identifier-format regexp, reserved-keyword lookup — differing only in the per-dialect data (max length, keyword set). Sharing the skeleton keeps the validation logic in one place while each dialect retains its own identifier rules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateFieldName ¶
func ValidateFieldName(name, dialectName string, maxLen int, nameRE *regexp.Regexp, reserved map[string]bool) error
ValidateFieldName checks that name is a safe unquoted SQL identifier for a dialect.
- dialectName appears in the length-limit error message (e.g. "PostgreSQL").
- maxLen is the maximum identifier length; pass 0 (or negative) to skip the length check for dialects that impose no practical limit.
- nameRE is the dialect's identifier-format pattern.
- reserved is the dialect's set of reserved keywords (lowercased keys).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.