From 3408004c8c8af148b2b6873e817813c1a706c3bf Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 31 Mar 2023 19:44:16 +0100 Subject: [PATCH] Add initial support for method chaining within an `Idiom` --- lib/src/sql/part.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/sql/part.rs b/lib/src/sql/part.rs index 533fc07d..07fc6ec5 100644 --- a/lib/src/sql/part.rs +++ b/lib/src/sql/part.rs @@ -1,6 +1,7 @@ use crate::sql::comment::shouldbespace; use crate::sql::ending::ident as ending; use crate::sql::error::IResult; +use crate::sql::fmt::Fmt; use crate::sql::graph::{self, Graph}; use crate::sql::ident::{self, Ident}; use crate::sql::idiom::Idiom; @@ -26,6 +27,7 @@ pub enum Part { Where(Value), Graph(Graph), Value(Value), + Method(String, Vec), } impl From for Part { @@ -106,6 +108,7 @@ impl fmt::Display for Part { Part::Where(v) => write!(f, "[WHERE {v}]"), Part::Graph(v) => write!(f, "{v}"), Part::Value(v) => write!(f, "{v}"), + Part::Method(v, a) => write!(f, ".{v}({})", Fmt::comma_separated(a)), } } }