From 050e7ab8beafd74aab6edaec8eeb18628285ecac Mon Sep 17 00:00:00 2001 From: Garet Halliday <me@garet.holiday> Date: Tue, 8 Nov 2022 16:16:41 -0600 Subject: [PATCH] add COMMENT keyword as write hint --- go.mod | 2 +- go.sum | 4 ++-- lib/gat/database/query_router/query_router.go | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 7a577076..a892137b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module gfx.cafe/gfx/pggat go 1.19 require ( - gfx.cafe/ghalliday1/pg3p v0.0.19 + gfx.cafe/ghalliday1/pg3p v0.1.0 gfx.cafe/ghalliday1/pgparser v0.0.9 gfx.cafe/util/go/bufpool v0.0.0-20220906091724-3a24b7f40ccf gfx.cafe/util/go/generic v0.0.0-20221001013022-0560a0526470 diff --git a/go.sum b/go.sum index f4e83154..677dc4dd 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gfx.cafe/ghalliday1/pg3p v0.0.19 h1:c78xhRKZzssQEKBgsg95n9Xh0ORiLY4GWp7KqlgFqRg= -gfx.cafe/ghalliday1/pg3p v0.0.19/go.mod h1:dVy94HSyywugiaUJm+4EyhC41TOL3SHSr+FUubKa7s8= +gfx.cafe/ghalliday1/pg3p v0.1.0 h1:9ONKLcJ+GzF4Fdg6x7xJk9mEkjlgAiU0T5iPVI46SWQ= +gfx.cafe/ghalliday1/pg3p v0.1.0/go.mod h1:dVy94HSyywugiaUJm+4EyhC41TOL3SHSr+FUubKa7s8= gfx.cafe/ghalliday1/pgparser v0.0.9 h1:mj1819zaEO964rFMr9lzGIoKLdZdjWAs6CqPvcSAhYg= gfx.cafe/ghalliday1/pgparser v0.0.9/go.mod h1:mte3a6XnIWVexcvJJrkYQ2ozbSx/soIJ4ivXf8pS1No= gfx.cafe/util/go/bufpool v0.0.0-20220906091724-3a24b7f40ccf h1:ya4IK1D+Kq0DrFdrrZ7tjmp3BgoO4v5sCAeUytR6j1U= diff --git a/lib/gat/database/query_router/query_router.go b/lib/gat/database/query_router/query_router.go index d1b298b2..3df02ff2 100644 --- a/lib/gat/database/query_router/query_router.go +++ b/lib/gat/database/query_router/query_router.go @@ -105,7 +105,8 @@ func (r *QueryRouter) InferRole(query string) (config.ServerRole, error) { lex.KeywordVacuum, lex.KeywordAnalyze, lex.KeywordAlter, - lex.KeywordGrant: + lex.KeywordGrant, + lex.KeywordComment: return config.SERVERROLE_PRIMARY, nil case lex.KeywordBegin: depth += 1 -- GitLab