From f29f6f61b5a397eea73ba852c084ad99f40d94a3 Mon Sep 17 00:00:00 2001 From: Garet Halliday <ghalliday@gfxlabs.io> Date: Thu, 29 Sep 2022 15:52:57 -0500 Subject: [PATCH] add create keyword as write hint --- lib/gat/database/query_router/query_router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gat/database/query_router/query_router.go b/lib/gat/database/query_router/query_router.go index a8f06a30..0cd06b4a 100644 --- a/lib/gat/database/query_router/query_router.go +++ b/lib/gat/database/query_router/query_router.go @@ -90,7 +90,7 @@ func (r *QueryRouter) InferRole(query string) (config.ServerRole, error) { var role = config.SERVERROLE_REPLICA for _, token := range tokens { switch token.Token { - case lex.KeywordUpdate, lex.KeywordDelete, lex.KeywordInsert, lex.KeywordDrop: + case lex.KeywordUpdate, lex.KeywordDelete, lex.KeywordInsert, lex.KeywordDrop, lex.KeywordCreate: role = config.SERVERROLE_PRIMARY } } -- GitLab