Skip to main content

Module sanitize

Module sanitize 

Source
Expand description

This module contains all the built-in sanitizers which can be applied to columns.

Each validation function takes a crate::prelude::Value as input and returns a DbmsResult<crate::prelude::Value> with the sanitized value or an error if the value could not be sanitized.

This module contains the Sanitize trait which should be implemented by all sanitizers.

Structs§

ClampSanitizer
Sanitizer that clamps integer values within a specified range.
ClampUnsignedSanitizer
Sanitizer that clamps unsigned integer values within a specified range.
CollapseWhitespaceSanitizer
Sanitizer that collapses multiple whitespace characters into a single space in strings.
LowerCaseSanitizer
Sanitizer that converts strings to lowercase.
NullIfEmptySanitizer
The NullIfEmptySanitizer struct is used to sanitize input by converting empty strings to null values.
RoundToScaleSanitizer
Sanitizer that rounds rust_decimal::Decimal values to a specified scale.
SlugSanitizer
Sanitizer sluggifies strings by converting them to lowercase, replacing spaces with hyphens, and removing non-alphanumeric characters.
TimezoneSanitizer
Sanitizer that ensures that all crate::prelude::DateTime values are within a specific timezone.
TrimSanitizer
Sanitizer that trims leading and trailing whitespace from strings.
UpperCaseSanitizer
Sanitizer that converts strings to uppercase.
UrlEncodingSanitizer
Sanitizer URL-encodes strings by converting them to percent-encoded format.
UtcSanitizer
Sanitizer that ensures that all crate::prelude::DateTime values are within the UTC timezone.

Traits§

Sanitize
Trait for sanitizing Values.