Struct dml_tools::Processor

source ·
pub struct Processor<'a> { /* private fields */ }
Expand description

DML processor and SQL generator

Collects DBObject’s and creates SQL sql_statements using the supplied TypeWriter or Postgresql if none is provided

Implementations§

source§

impl<'a> Processor<'a>

source

pub fn new(type_writer: Option<Box<dyn TypeWriter>>) -> Self

Create a new Processor optionally specifying a TypeWriter to use

source

pub fn new_with_objects( objects: &'a Vec<Box<dyn DBObject>>, type_writer: Option<Box<dyn TypeWriter>> ) -> Self

Create a new Processor optionally specifying a TypeWriter to use

source

pub fn add(&mut self, object: &'a dyn DBObject) -> &Self

Add a DB object

source

pub fn sql_statements(&self) -> Vec<String>

Get the list of serialized SQL sql_statements

source

pub fn join_sql_statements(&self) -> String

Get a String with all of the SQL statments

source

pub fn serialize_to_yaml_file( &self, file_name: &str ) -> Result<(), Box<dyn Error>>

Write objects to a YAML file

source

pub fn write_to_sql_file(&self, file_name: &str) -> Result<(), Box<dyn Error>>

Write generated SQL to file

source

pub fn objects(&self) -> &Vec<Box<&'a dyn DBObject>>

Get number of objects present

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Processor<'a>

§

impl<'a> !Send for Processor<'a>

§

impl<'a> !Sync for Processor<'a>

§

impl<'a> Unpin for Processor<'a>

§

impl<'a> !UnwindSafe for Processor<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.