Module value_binding

Module value_binding 

Source
Expand description

Value binding utilities for SQL queries.

Provides type-safe value binding with automatic type detection and conversion, supporting all SQL types across different database drivers.

§Value Binding Module

This module provides type-safe value binding utilities for SQL queries. It handles conversion from Rust types to database-native types across different database drivers (PostgreSQL, MySQL, SQLite).

§Features

  • Type-Safe Binding: Automatic type detection and conversion
  • Driver-Specific Optimization: Uses native types when possible
  • Temporal Type Support: Specialized handling for DateTime types via temporal module
  • UUID Support: Handles all UUID versions (1-7)
  • Error Handling: Graceful fallback for parsing errors

Traits§

ValueBinder
Extension trait for binding values to AnyArguments with driver-specific handling.

Functions§

bind_typed_value
Binds a value to AnyArguments with automatic type detection and conversion.
bind_typed_value_or_string
Attempts to bind a value, falling back to string binding on error.
is_numeric_type
Returns whether a SQL type is numeric.
is_text_type
Returns whether a SQL type is textual.
requires_special_binding
Detects if a SQL type requires special handling.