Skip to content

Commit

Permalink
fix: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Nov 6, 2024
1 parent c5276b3 commit ef0ec5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/proof-of-sql-parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions crates/proof-of-sql-parser/src/sqlparser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Identifier> 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<ResourceId> for ObjectName {
fn from(resource_id: ResourceId) -> Self {
let schema_ident = Ident::new(resource_id.schema().as_str());
Expand All @@ -21,7 +21,7 @@ impl From<ResourceId> 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<IntermediateOrderBy> for OrderByExpr {
fn from(intermediate_order_by: IntermediateOrderBy) -> Self {
// Convert Identifier to Expr
Expand All @@ -41,7 +41,7 @@ impl From<IntermediateOrderBy> 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<Slice> for Offset {
fn from(slice: Slice) -> Self {
let value_expr = Expr::Value(Value::Number(slice.offset_value.to_string(), false));
Expand Down

0 comments on commit ef0ec5f

Please sign in to comment.