pub struct InsertArgs {
pub objects: Vec<HashMap<String, InputValue>>,
pub on_conflict: Option<OnConflictArgs>,
pub returning: Vec<String>,
}Expand description
Arguments for a GraphQL insert mutation.
Fields§
§objects: Vec<HashMap<String, InputValue>>Objects to insert
on_conflict: Option<OnConflictArgs>On conflict handling
returning: Vec<String>Fields to return
Implementations§
Source§impl InsertArgs
impl InsertArgs
Sourcepub fn with_object(self, object: HashMap<String, InputValue>) -> Self
pub fn with_object(self, object: HashMap<String, InputValue>) -> Self
Add an object to insert.
Sourcepub fn with_objects(self, objects: Vec<HashMap<String, InputValue>>) -> Self
pub fn with_objects(self, objects: Vec<HashMap<String, InputValue>>) -> Self
Add multiple objects to insert.
Sourcepub fn with_on_conflict(self, on_conflict: OnConflictArgs) -> Self
pub fn with_on_conflict(self, on_conflict: OnConflictArgs) -> Self
Set on conflict handling.
Sourcepub fn with_returning(self, returning: Vec<String>) -> Self
pub fn with_returning(self, returning: Vec<String>) -> Self
Set returning fields.
Sourcepub fn has_objects(&self) -> bool
pub fn has_objects(&self) -> bool
Check if there are objects to insert.
Sourcepub fn object_count(&self) -> usize
pub fn object_count(&self) -> usize
Get the number of objects to insert.
Sourcepub fn to_json_bytes(&self) -> Option<Bytes>
pub fn to_json_bytes(&self) -> Option<Bytes>
Convert objects to JSON bytes.
Sourcepub fn column_names(&self) -> Vec<String>
pub fn column_names(&self) -> Vec<String>
Get column names from the first object.
Trait Implementations§
Source§impl Clone for InsertArgs
impl Clone for InsertArgs
Source§fn clone(&self) -> InsertArgs
fn clone(&self) -> InsertArgs
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InsertArgs
impl Debug for InsertArgs
Source§impl Default for InsertArgs
impl Default for InsertArgs
Source§fn default() -> InsertArgs
fn default() -> InsertArgs
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InsertArgs
impl RefUnwindSafe for InsertArgs
impl Send for InsertArgs
impl Sync for InsertArgs
impl Unpin for InsertArgs
impl UnwindSafe for InsertArgs
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more