From 5e41f79e05444301b8074ca84dd23795f8b38014 Mon Sep 17 00:00:00 2001 From: Shamim Mohamed Date: Mon, 4 May 2020 15:51:03 -0700 Subject: [PATCH] Docstore reserved words list --- names.go | 12 ++++++------ names_test.go | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/names.go b/names.go index e828d474..8f4d8877 100644 --- a/names.go +++ b/names.go @@ -52,12 +52,12 @@ func init() { "rename", "replace", "revoke", "schema", "select", "set", "table", "to", "token", "truncate", "unlogged", "update", "use", "using", "where", "with", } - docstoreRsvd := []string{} // Temporarily removed, shamim 2020-05-04 - // "and", "array", "cast", "contains", "data", "default", "distinct", "else", - // "false", "from", "group", "having", "interval", "limit", "metadata", - // "null", "offset", "or", "order", "partition_key", "partition", "row_key", - // "select", "tombstone", "true", "ts", "where", - // } + docstoreRsvd := []string{ + "and", "array", "cast", "contains", "data", "default", "distinct", "else", + "false", "from", "group", "having", "interval", "limit", "metadata", + "null", "offset", "or", "order", "partition_key", "partition", "row_key", + "select", "tombstone", "true", "ts", "where", + } reserved = make(map[string]struct{}) for _, n := range cassandraRsvd { reserved[n] = struct{}{} diff --git a/names_test.go b/names_test.go index 239bd454..2f3c8793 100644 --- a/names_test.go +++ b/names_test.go @@ -71,6 +71,10 @@ func TestIsValidName(t *testing.T) { arg: "keyspace", err: "reserved word", }, + { + arg: "partition_key", + err: "reserved word", + }, { arg: "schema", err: "reserved word",