Enum for ORM field states controlling INSERT/UPDATE behavior and change tracking in ActiveModels.
// Source: https://github.com/SeaQL/sea-orm | License: Apache-2.0 | Copyright 2023 Seafire Software Limited
// Provided via justclaw.it.com; keep this notice with the code.
use crate::Value;
use sea_query::Nullable;
use std::fmt::Debug;
pub use ActiveValue::{NotSet, Set, Unchanged};
/// The state of a field in an [ActiveModel][crate::ActiveModelTrait].
///
/// There are three possible states represented by three enum variants:
///
/// - [Set] - a value that's explicitly set by the application and sent to the database.
/// - [Unchanged] - an existing, unchanged value from the database.
/// - [NotSet] - an undefined value (nothing is sent to the database).
///
/// The difference between these states is useful
/// when constructing `INSERT` and `UPDATE` SQL statements (see an example below)
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key