mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-18 14:00:39 +00:00
feat: impl Display for Statement (#3744)
* feat: impl Display for Statement * fix: add license header * fix: inline function manually * fix: redacte options * fix: check secret key and replace value * test: add test for statement display * fix: fix check * fix: inline method * fix: inline methods * fix: format * showcase how to write Display impl Signed-off-by: tison <wander4096@gmail.com> * for others Signed-off-by: tison <wander4096@gmail.com> * create and copy Signed-off-by: tison <wander4096@gmail.com> * create rest Signed-off-by: tison <wander4096@gmail.com> * fixup Signed-off-by: tison <wander4096@gmail.com> * address comments Signed-off-by: tison <wander4096@gmail.com> * fixup quote Signed-off-by: tison <wander4096@gmail.com> --------- Signed-off-by: tison <wander4096@gmail.com> Co-authored-by: tison <wander4096@gmail.com>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use std::fmt::{Debug, Display, Formatter};
|
||||
use std::sync::Arc;
|
||||
|
||||
use api::greptime_proto::v1::add_column_location::LocationType;
|
||||
@@ -126,6 +126,17 @@ pub enum AddColumnLocation {
|
||||
After { column_name: String },
|
||||
}
|
||||
|
||||
impl Display for AddColumnLocation {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
AddColumnLocation::First => write!(f, r#"FIRST"#),
|
||||
AddColumnLocation::After { column_name } => {
|
||||
write!(f, r#"AFTER {column_name}"#)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&AddColumnLocation> for Location {
|
||||
fn from(value: &AddColumnLocation) -> Self {
|
||||
match value {
|
||||
|
||||
Reference in New Issue
Block a user