pub trait ToNodeBuilder<T: Display = Self>: Display {
fn with(&self, relation_or_node: &str) -> String { ... }
fn from(&self, node: &str) -> String { ... }
fn as_named_label(&self, label_name: &str) -> String { ... }
fn equals(&self, value: &str) -> String { ... }
fn equals_parameterized(&self) -> String { ... }
}
Provided Methods
sourcefn with(&self, relation_or_node: &str) -> String
fn with(&self, relation_or_node: &str) -> String
Draws the start of a relation ->node
Example
use surreal_simple_querybuilder::prelude::*;
let s = "user".with("project");
assert_eq!("user->project", s);
sourcefn from(&self, node: &str) -> String
fn from(&self, node: &str) -> String
Draws the end of a relation <-node
Example
use surreal_simple_querybuilder::prelude::*;
let s = "user".from("project");
assert_eq!("user<-project", s);
sourcefn 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
Example
use surreal_simple_querybuilder::prelude::*;
let label = "John".as_named_label("Account");
assert_eq!(label, "Account:John");
sourcefn equals(&self, value: &str) -> String
fn equals(&self, value: &str) -> String
Example
use surreal_simple_querybuilder::prelude::*;
let s = "user".equals("John");
// Note that it doesn't add quotes around strings
assert_eq!("user = John", s);
sourcefn equals_parameterized(&self) -> String
fn equals_parameterized(&self) -> String
Take the current string and add = $current_string
after it
Example
use surreal_simple_querybuilder::prelude::*;
let s = "account".equals_parameterized();
assert_eq!("account = $account", s);