From 54e59369039ba7fef02252955757d672e24ce64d Mon Sep 17 00:00:00 2001 From: kai Date: Mon, 22 Feb 2021 18:02:11 +0000 Subject: [PATCH] Fix error for missing required quals. Closes #40 --- plugin/table_fetch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/table_fetch.go b/plugin/table_fetch.go index 65e821a1..2dcd887f 100644 --- a/plugin/table_fetch.go +++ b/plugin/table_fetch.go @@ -44,7 +44,7 @@ func (t *Table) fetchItems(ctx context.Context, queryData *QueryData) error { func (t *Table) executeGetCall(ctx context.Context, queryData *QueryData) (err error) { logger := t.Plugin.Logger // verify we have the necessary quals - if queryData.KeyColumnQuals == nil { + if len(queryData.KeyColumnQuals) == 0 { return status.Error(codes.Internal, fmt.Sprintf("'Get' call requires an '=' qual for %s", t.Get.KeyColumns.ToString())) } @@ -240,7 +240,7 @@ func (t *Table) executeListCall(ctx context.Context, queryData *QueryData) { }() // verify we have the necessary quals - if t.List.KeyColumns != nil && queryData.KeyColumnQuals == nil { + if t.List.KeyColumns != nil && len(queryData.KeyColumnQuals) == 0 { queryData.streamError(status.Error(codes.Internal, fmt.Sprintf("'List' call requires an '=' qual for %s", t.List.KeyColumns.ToString()))) }