pub struct SqlDoc { /* private fields */ }Expand description
Top-level documentation object containing all discovered TableDoc entries.
Implementations§
Source§impl SqlDoc
impl SqlDoc
Sourcepub fn from_dir<P: AsRef<Path>>(root: &P) -> SqlDocBuilder<'_>
pub fn from_dir<P: AsRef<Path>>(root: &P) -> SqlDocBuilder<'_>
Method for generating builder from a directory.
Sourcepub fn from_path<P: AsRef<Path> + ?Sized>(path: &P) -> SqlDocBuilder<'_>
pub fn from_path<P: AsRef<Path> + ?Sized>(path: &P) -> SqlDocBuilder<'_>
Method for generating builder from a Path of a single file
Sourcepub fn from_paths<P: AsRef<Path>>(paths: &[P]) -> SqlDocBuilder<'_>
pub fn from_paths<P: AsRef<Path>>(paths: &[P]) -> SqlDocBuilder<'_>
Method for generating builder from a [[Path]]
Sourcepub const fn builder_from_str(content: &str) -> SqlDocBuilder<'_>
pub const fn builder_from_str(content: &str) -> SqlDocBuilder<'_>
Creates a builder from SQL text (no filesystem path is associated) from a str
Sourcepub const fn builder_from_strs_with_paths(
string_with_path: &[(String, PathBuf)],
) -> SqlDocBuilder<'_>
pub const fn builder_from_strs_with_paths( string_with_path: &[(String, PathBuf)], ) -> SqlDocBuilder<'_>
Sourcepub fn table(
&self,
name: &str,
schema: Option<&str>,
) -> Result<&TableDoc, DocError>
pub fn table( &self, name: &str, schema: Option<&str>, ) -> Result<&TableDoc, DocError>
Method for finding a specific TableDoc by name
§Parameters
§Errors
- Will return
DocError::TableNotFoundif the expected table is not found - Will return
DocError::TableWithSchemaNotFoundif the table name exists but no table matches the given schema - Will return
DocError::DuplicateTablesFoundif more than one matching table is found
Sourcepub fn tables_mut(&mut self) -> &mut [TableDoc]
pub fn tables_mut(&mut self) -> &mut [TableDoc]
Getter that returns a mutable reference to the TableDoc
Sourcepub fn into_tables(self) -> Vec<TableDoc>
pub fn into_tables(self) -> Vec<TableDoc>
Method to move tables out of Structure if needed
Sourcepub fn number_of_tables(&self) -> usize
pub fn number_of_tables(&self) -> usize
Returns the number of TableDoc
Trait Implementations§
impl Eq for SqlDoc
impl StructuralPartialEq for SqlDoc
Auto Trait Implementations§
impl Freeze for SqlDoc
impl RefUnwindSafe for SqlDoc
impl Send for SqlDoc
impl Sync for SqlDoc
impl Unpin for SqlDoc
impl UnwindSafe for SqlDoc
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