From 94a03e5b03f9e3c6de22904bb6dd7c3a7e96d9ae Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Fri, 19 Nov 2021 09:55:10 -0800 Subject: [PATCH] Add Timestamp type to cassandra column types and wrap Timestamp value inside single quotes when creating queries (#1163) --- src/Explorer/Panes/Tables/Validators/EntityTableHelper.tsx | 2 ++ src/Explorer/Tables/Constants.ts | 1 + src/Explorer/Tables/TableDataClient.ts | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Explorer/Panes/Tables/Validators/EntityTableHelper.tsx b/src/Explorer/Panes/Tables/Validators/EntityTableHelper.tsx index b38f569e0..71cfa9c8b 100644 --- a/src/Explorer/Panes/Tables/Validators/EntityTableHelper.tsx +++ b/src/Explorer/Panes/Tables/Validators/EntityTableHelper.tsx @@ -33,6 +33,7 @@ const { Inet, Smallint, Tinyint, + Timestamp, } = TableConstants.CassandraType; export const cassandraOptions = [ { key: Text, text: Text }, @@ -50,6 +51,7 @@ export const cassandraOptions = [ { key: Inet, text: Inet }, { key: Smallint, text: Smallint }, { key: Tinyint, text: Tinyint }, + { key: Timestamp, text: Timestamp }, ]; export const imageProps: IImageProps = { diff --git a/src/Explorer/Tables/Constants.ts b/src/Explorer/Tables/Constants.ts index 9bb313b7a..c9917dcd8 100644 --- a/src/Explorer/Tables/Constants.ts +++ b/src/Explorer/Tables/Constants.ts @@ -19,6 +19,7 @@ export const CassandraType = { Float: "Float", Int: "Int", Text: "Text", + Timestamp: "Timestamp", Uuid: "Uuid", Varchar: "Varchar", Varint: "Varint", diff --git a/src/Explorer/Tables/TableDataClient.ts b/src/Explorer/Tables/TableDataClient.ts index afe31b711..62463abfd 100644 --- a/src/Explorer/Tables/TableDataClient.ts +++ b/src/Explorer/Tables/TableDataClient.ts @@ -535,7 +535,8 @@ export class CassandraAPIDataClient extends TableDataClient { dataType === TableConstants.CassandraType.Text || dataType === TableConstants.CassandraType.Inet || dataType === TableConstants.CassandraType.Ascii || - dataType === TableConstants.CassandraType.Varchar + dataType === TableConstants.CassandraType.Varchar || + dataType === TableConstants.CassandraType.Timestamp ); }