bind_naive_datetime

Function bind_naive_datetime 

Source
pub fn bind_naive_datetime(
    query_args: &mut AnyArguments<'_>,
    value: &NaiveDateTime,
    driver: &Drivers,
) -> Result<(), Error>
Expand description

Binds a NaiveDateTime value to a SQL query based on the database driver.

§Arguments

  • query_args - The SQLx AnyArguments to bind the value to
  • value - The NaiveDateTime value to bind
  • driver - The database driver being used

§Database-Specific Behavior

§PostgreSQL

  • Uses TIMESTAMP (without timezone) type
  • Stores as-is without timezone conversion

§MySQL

  • Uses DATETIME type (no Y2038 limit)
  • Stores without timezone information
  • Range: ‘1000-01-01 00:00:00’ to ‘9999-12-31 23:59:59’

§SQLite

  • Stores as TEXT in ISO 8601 format
  • Format: “YYYY-MM-DD HH:MM:SS.SSS”