Skip to content

Commit f79a7fc

Browse files
committed
work on sqldocs builder and modifying TableDocs struct for schema
1 parent abc4524 commit f79a7fc

3 files changed

Lines changed: 35 additions & 7 deletions

File tree

src/docs.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ impl ColumnDoc {
3737
}
3838
}
3939

40-
/// Structure for containing the `name` of the `Table`, an [`Option`] for the
41-
/// comment as a [`String`], and a `Vec` of [`ColumnDoc`] contained in the table
40+
/// Structure for containing the `name` of the `Table`, an [`Option`] for if the
41+
/// table has a schema, an [`Option`] for the comment as a [`String`], and a
42+
/// `Vec` of [`ColumnDoc`] contained in the table
4243
#[derive(Clone, Debug, Eq, PartialEq)]
4344
pub struct TableDoc {
4445
name: String,
46+
schema: Option<String>,
4547
doc: Option<String>,
4648
columns: Vec<ColumnDoc>,
4749
}
@@ -154,6 +156,9 @@ impl SqlDocs {
154156
}
155157
}
156158

159+
160+
161+
157162
#[cfg(test)]
158163
mod tests {
159164
use crate::docs::{ColumnDoc, SqlDocs, TableDoc};

src/lib.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,34 @@ impl From<ParserError> for DocError {
7575
}
7676
}
7777

78+
/// Struct for the SqlDoc
79+
pub struct SqlDoc {
80+
files: Vec<(PathBuf, SqlDocs)>,
81+
}
82+
83+
impl SqlDoc {
84+
pub fn table (&self, name: &str) -> Result<&TableDoc, DocError> {
85+
86+
}
87+
pub fn table_with_schema(&self, schema: &str, name: &str) -> Result<&TableDoc, DocError> {
88+
89+
}
90+
pub fn from_path(path: &Path) -> {
91+
92+
}
93+
}
94+
/// Builder struct for the [`SqlDoc`]
95+
pub struct SqlDocBuilder {
96+
sql_docs: SqlDoc,
97+
}
98+
impl SqlDocsBuilder {
99+
fn new() -> Self {
100+
Self {}
101+
}
102+
}
103+
104+
105+
78106
/// Primary Entry point. Returns a tuple of [`PathBuf`] and [`SqlDocs`].
79107
///
80108
/// # Parameters:

src/sql_doc.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
2-
pub struct SqlDoc {
3-
files: Vec<(PathBuf, FileDoc)>,
4-
}
5-

0 commit comments

Comments
 (0)