pub struct KV {Show 23 fields
pub key1: String,
pub key2: String,
pub string_val: String,
pub int_val: i64,
pub small_int: i16,
pub unsigned_val: u32,
pub float_val: f32,
pub double_val: f64,
pub boolean_val: bool,
pub opt_string: Option<String>,
pub opt_int: Option<i64>,
pub opt_float: Option<f64>,
pub opt_bool: Option<bool>,
pub uuid: Uuid,
pub opt_uuid: Option<Uuid>,
pub fixed_bytes: [u8; 16],
pub numbers: [i32; 4],
pub tags: Vec<String>,
pub scores: Vec<i32>,
pub floats: Option<Vec<f64>>,
pub shared_strings: Arc<Vec<String>>,
pub metadata: BTreeMap<String, String>,
pub counters: Option<BTreeMap<String, i64>>,
}Fields§
§key1: String§key2: String§string_val: String§int_val: i64§small_int: i16§unsigned_val: u32§float_val: f32§double_val: f64§boolean_val: bool§opt_string: Option<String>§opt_int: Option<i64>§opt_float: Option<f64>§opt_bool: Option<bool>§uuid: Uuid§opt_uuid: Option<Uuid>§fixed_bytes: [u8; 16]§numbers: [i32; 4]§scores: Vec<i32>§floats: Option<Vec<f64>>§metadata: BTreeMap<String, String>§counters: Option<BTreeMap<String, i64>>Trait Implementations§
Source§impl Entity for KV
impl Entity for KV
Source§type PrimaryKey<'a> = (&'a String, &'a String)
type PrimaryKey<'a> = (&'a String, &'a String)
Primary key type. A tuple of field types (or single type) forming the PK.
Source§fn primary_key_def() -> &'static [&'static ColumnDef]
fn primary_key_def() -> &'static [&'static ColumnDef]
Primary key column definitions. Empty if no PK defined.
Source§fn primary_key<'a>(&'a self) -> Self::PrimaryKey<'a>
fn primary_key<'a>(&'a self) -> Self::PrimaryKey<'a>
Extract PK value(s) from
self.Source§fn primary_key_expr(&self) -> impl Expression
fn primary_key_expr(&self) -> impl Expression
Build an expression matching the PK of
self.Source§fn unique_defs() -> impl ExactSizeIterator<Item = impl ExactSizeIterator<Item = &'static ColumnDef>>
fn unique_defs() -> impl ExactSizeIterator<Item = impl ExactSizeIterator<Item = &'static ColumnDef>>
Unique constraint definitions.
Source§fn row_filtered(&self) -> Box<[(&'static str, Value)]>
fn row_filtered(&self) -> Box<[(&'static str, Value)]>
Column name-value pairs for persistence (excludes ignored/default fields).
Source§fn row_labeled(&self) -> Row
fn row_labeled(&self) -> Row
Full row representation with column labels.
Source§fn create_table(
executor: &mut impl Executor,
if_not_exists: bool,
create_schema: bool,
) -> impl Future<Output = Result<(), Error>> + Sendwhere
Self: Sized,
fn create_table(
executor: &mut impl Executor,
if_not_exists: bool,
create_schema: bool,
) -> impl Future<Output = Result<(), Error>> + Sendwhere
Self: Sized,
Create table (and optional schema). Read more
Source§fn drop_table(
executor: &mut impl Executor,
if_exists: bool,
drop_schema: bool,
) -> impl Future<Output = Result<(), Error>> + Sendwhere
Self: Sized,
fn drop_table(
executor: &mut impl Executor,
if_exists: bool,
drop_schema: bool,
) -> impl Future<Output = Result<(), Error>> + Sendwhere
Self: Sized,
Drop the table (and optional schema). Read more
Source§fn insert_one(
executor: &mut impl Executor,
entity: &impl Entity,
) -> impl Future<Output = Result<RowsAffected, Error>> + Send
fn insert_one( executor: &mut impl Executor, entity: &impl Entity, ) -> impl Future<Output = Result<RowsAffected, Error>> + Send
Insert a single entity.
Source§fn insert_many<'a, It>(
executor: &mut impl Executor,
items: It,
) -> impl Future<Output = Result<RowsAffected, Error>> + Sendwhere
Self: Sized + 'a,
It: IntoIterator<Item = &'a Self> + Send,
<It as IntoIterator>::IntoIter: Send,
fn insert_many<'a, It>(
executor: &mut impl Executor,
items: It,
) -> impl Future<Output = Result<RowsAffected, Error>> + Sendwhere
Self: Sized + 'a,
It: IntoIterator<Item = &'a Self> + Send,
<It as IntoIterator>::IntoIter: Send,
Bulk insert entities.
Source§fn prepare_find<Exec>(
executor: &mut Exec,
condition: impl Expression,
limit: Option<u32>,
) -> impl Future<Output = Result<Query<<Exec as Executor>::Driver>, Error>>where
Exec: Executor,
fn prepare_find<Exec>(
executor: &mut Exec,
condition: impl Expression,
limit: Option<u32>,
) -> impl Future<Output = Result<Query<<Exec as Executor>::Driver>, Error>>where
Exec: Executor,
Prepare (but do not yet run) a SQL select query. Read more
Source§fn find_one(
executor: &mut impl Executor,
condition: impl Expression,
) -> impl Future<Output = Result<Option<Self>, Error>> + Sendwhere
Self: Sized,
fn find_one(
executor: &mut impl Executor,
condition: impl Expression,
) -> impl Future<Output = Result<Option<Self>, Error>> + Sendwhere
Self: Sized,
Finds the first entity matching a condition expression. Read more
Source§fn find_many(
executor: &mut impl Executor,
condition: impl Expression,
limit: Option<u32>,
) -> impl Stream<Item = Result<Self, Error>> + Sendwhere
Self: Sized,
fn find_many(
executor: &mut impl Executor,
condition: impl Expression,
limit: Option<u32>,
) -> impl Stream<Item = Result<Self, Error>> + Sendwhere
Self: Sized,
Streams entities matching a condition. Read more
Source§fn delete_many(
executor: &mut impl Executor,
condition: impl Expression,
) -> impl Future<Output = Result<RowsAffected, Error>> + Sendwhere
Self: Sized,
fn delete_many(
executor: &mut impl Executor,
condition: impl Expression,
) -> impl Future<Output = Result<RowsAffected, Error>> + Sendwhere
Self: Sized,
Deletes all entities matching a condition. Read more
Source§impl KVColumnTrait for KV
impl KVColumnTrait for KV
const key1: ColumnRef
const key2: ColumnRef
const string_val: ColumnRef
const int_val: ColumnRef
const small_int: ColumnRef
const unsigned_val: ColumnRef
const float_val: ColumnRef
const double_val: ColumnRef
const boolean_val: ColumnRef
const opt_string: ColumnRef
const opt_int: ColumnRef
const opt_float: ColumnRef
const opt_bool: ColumnRef
const uuid: ColumnRef
const opt_uuid: ColumnRef
const fixed_bytes: ColumnRef
const numbers: ColumnRef
const scores: ColumnRef
const floats: ColumnRef
const metadata: ColumnRef
const counters: ColumnRef
impl StructuralPartialEq for KV
Auto Trait Implementations§
impl Freeze for KV
impl RefUnwindSafe for KV
impl Send for KV
impl Sync for KV
impl Unpin for KV
impl UnsafeUnpin for KV
impl UnwindSafe for KV
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<E> Dataset for Ewhere
E: Entity,
impl<E> Dataset for Ewhere
E: Entity,
Source§fn qualified_columns() -> bool
fn qualified_columns() -> bool
Indicates whether column names should be fully qualified with schema and table name.
For entities this returns false to keep queries concise, for joins it returns true.