From ef0ec5fc90204cacca1233156b5592110e5f9caf Mon Sep 17 00:00:00 2001 From: Vamshi Maskuri <117595548+varshith257@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:52:44 +0530 Subject: [PATCH] fix: docs --- crates/proof-of-sql-parser/src/lib.rs | 1 + crates/proof-of-sql-parser/src/sqlparser.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/proof-of-sql-parser/src/lib.rs b/crates/proof-of-sql-parser/src/lib.rs index d58de3721..d1b022b1a 100644 --- a/crates/proof-of-sql-parser/src/lib.rs +++ b/crates/proof-of-sql-parser/src/lib.rs @@ -16,6 +16,7 @@ mod intermediate_ast_tests; /// Shortcuts to construct intermediate AST nodes. pub mod utility; +/// Adapts `PoSQL` parser to work with sqlparser AST types. pub mod sqlparser; /// TODO: add docs diff --git a/crates/proof-of-sql-parser/src/sqlparser.rs b/crates/proof-of-sql-parser/src/sqlparser.rs index 7bbf67b70..596198d4c 100644 --- a/crates/proof-of-sql-parser/src/sqlparser.rs +++ b/crates/proof-of-sql-parser/src/sqlparser.rs @@ -5,14 +5,14 @@ use crate::{ use alloc::{string::ToString, vec}; use sqlparser::ast::{Expr, Ident, ObjectName, Offset, OffsetRows, OrderByExpr, Value}; -/// Converts a [`Identifier`] from the PoSQL AST to an `Ident` for the SQLParser AST. +/// Converts a [`Identifier`] from the `PoSQL` AST to an [`Ident`] for the `SQLParser` AST. impl From for Ident { fn from(id: Identifier) -> Self { Ident::new(id.as_str()) } } -/// Converts a [`ResourceId`] from the PoSQL AST to an [`ObjectName`] for the SQLParser AST. +/// Converts a [`ResourceId`] from the `PoSQL` AST to an [`ObjectName`] for the `SQLParser` AST. impl From for ObjectName { fn from(resource_id: ResourceId) -> Self { let schema_ident = Ident::new(resource_id.schema().as_str()); @@ -21,7 +21,7 @@ impl From for ObjectName { } } -/// Converts an [`IntermediateOrderBy`] from the intermediate AST to a [`OrderByExpr`] for the SQLParser AST. +/// Converts an [`IntermediateOrderBy`] from the intermediate AST to a [`OrderByExpr`] for the `SQLParser` AST. impl From for OrderByExpr { fn from(intermediate_order_by: IntermediateOrderBy) -> Self { // Convert Identifier to Expr @@ -41,7 +41,7 @@ impl From for OrderByExpr { } } -/// Converts a [`Slice`] representing pagination into an [`Offset`] for the SQL parser. +/// Converts a [`Slice`] representing pagination into an [`Offset`] for the `SQLParser`. impl From for Offset { fn from(slice: Slice) -> Self { let value_expr = Expr::Value(Value::Number(slice.offset_value.to_string(), false));