Summary
Define and expose a structured documentation model over SQL files (tables + columns + docs), and add tests to verify correct association of comments to AST elements.
Proposed data structures
struct SqlDocs {
tables: Vec<TableDoc>,
}
struct TableDoc {
name: String,
doc: Option<String>,
columns: Vec<ColumnDoc>,
}
struct ColumnDoc {
name: String,
doc: Option<String>,
}
Requirements
- Use
PathBuf internally for file references to avoid lifetime issues (where needed).
- Ensure the model can be constructed from:
- Parsed statements (
sqlparser AST)
- Extracted comment blocks from the original source text.
Tasks
Summary
Define and expose a structured documentation model over SQL files (tables + columns + docs), and add tests to verify correct association of comments to AST elements.
Proposed data structures
Requirements
PathBufinternally for file references to avoid lifetime issues (where needed).sqlparserAST)Tasks
SqlDocs,TableDoc, andColumnDocas the public-facing documentation model.SqlDocsfrom:SqlFileSet.CREATE TABLEbecomeTableDoc::doc.ColumnDoc::doc.