Struct surreal_simple_querybuilder::model::SchemaField
source · Fields§
§identifier: &'static str
Implementations§
source§impl<const N: usize> SchemaField<N>
impl<const N: usize> SchemaField<N>
pub const fn new(identifier: &'static str, field_type: SchemaFieldType) -> Self
pub const fn with_origin(
identifier: &'static str,
field_type: SchemaFieldType,
origin: Option<OriginHolder<N>>
) -> Self
pub fn from_alias(self, alias: &'static str) -> SchemaField<{ _ }>
sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Return the name of the field, and if the field is an edge then return the name of the edge instead.
Example
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
use surreal_simple_querybuilder::prelude::*;
model!(Test {
normal_field,
->edge->Test as test_edge
});
assert_eq!("normal_field", schema::model.normal_field.name());
assert_eq!("edge", schema::model.test_edge.name());
Trait Implementations§
source§impl<const N: usize> Display for SchemaField<N>
impl<const N: usize> Display for SchemaField<N>
source§impl<const N: usize> Serialize for SchemaField<N>
impl<const N: usize> Serialize for SchemaField<N>
source§impl<const N: usize> ToNodeBuilder<SchemaField<N>> for SchemaField<N>
impl<const N: usize> ToNodeBuilder<SchemaField<N>> for SchemaField<N>
source§fn equals_parameterized(&self) -> String
fn equals_parameterized(&self) -> String
Take the current string and add
= $current_string
after it Read morefn quoted(&self) -> String
source§fn with(&self, relation_or_node: &str) -> String
fn with(&self, relation_or_node: &str) -> String
Draws the start of a relation
->node
Read moresource§fn as_named_label(&self, label_name: &str) -> String
fn as_named_label(&self, label_name: &str) -> String
Take the current string and add in front of it the given label name as to
make a string of the following format
LabelName:CurrentString
Read moresource§fn greater_than(&self, value: &str) -> String
fn greater_than(&self, value: &str) -> String
Take the current string add add
> value
after it Read moresource§fn as_alias(&self, alias: &str) -> String
fn as_alias(&self, alias: &str) -> String
Take the current string and add
as alias
after it Read moresource§fn filter(&self, condition: &str) -> String
fn filter(&self, condition: &str) -> String
Take the current string, extract the last segment if it is a nested property,
then add parenthesis around it and add the supplied condition in them. Read more
source§fn comma(&self, right: &str) -> String
fn comma(&self, right: &str) -> String
write a comma at the end of the string and append
right
after it. Read more