zino_orm

Trait EncodeColumn

Source
pub trait EncodeColumn<DB> {
    // Required methods
    fn column_type(&self) -> &str;
    fn encode_value<'a>(&self, value: Option<&'a JsonValue>) -> Cow<'a, str>;
    fn format_value<'a>(&self, value: &'a str) -> Cow<'a, str>;
    fn format_filter(&self, key: &str, value: &JsonValue) -> String;
}
Expand description

Encodes the column to be sent to the database.

Required Methods§

Source

fn column_type(&self) -> &str

Returns the corresponding column type in the database.

Source

fn encode_value<'a>(&self, value: Option<&'a JsonValue>) -> Cow<'a, str>

Encodes a json value as a column value represented by a str.

Source

fn format_value<'a>(&self, value: &'a str) -> Cow<'a, str>

Formats a string value for the column.

Source

fn format_filter(&self, key: &str, value: &JsonValue) -> String

Formats a column filter.

Implementations on Foreign Types§

Source§

impl EncodeColumn<Sqlite> for Column<'_>

Source§

fn column_type(&self) -> &str

Source§

fn encode_value<'a>(&self, value: Option<&'a JsonValue>) -> Cow<'a, str>

Source§

fn format_value<'a>(&self, value: &'a str) -> Cow<'a, str>

Source§

fn format_filter(&self, field: &str, value: &JsonValue) -> String

Implementors§