From 8cbd795990f6e5b17e4ae40f30c90ef97b09e8f1 Mon Sep 17 00:00:00 2001 From: Chandra Sanapala Date: Thu, 21 Nov 2024 13:12:49 +0530 Subject: [PATCH] Add walrusiq qtags --- go/pkg/qtag/declarations/walrusiq.yaml | 10 ++++++ go/pkg/qtag/generated.go | 42 ++++++++++++++++++++++++++ tests/test.yaml | 13 ++++++++ 3 files changed, 65 insertions(+) create mode 100644 go/pkg/qtag/declarations/walrusiq.yaml diff --git a/go/pkg/qtag/declarations/walrusiq.yaml b/go/pkg/qtag/declarations/walrusiq.yaml new file mode 100644 index 0000000..e97f0ac --- /dev/null +++ b/go/pkg/qtag/declarations/walrusiq.yaml @@ -0,0 +1,10 @@ +name: walrusiq +site: "https://sundeck.io" +identifier: + fields: + app: walrusiq +fields: + - name: app + type: APPLICATION + - name: suggested_warehouse_size + type: DIMENSION diff --git a/go/pkg/qtag/generated.go b/go/pkg/qtag/generated.go index 6dd5c4e..8f9e209 100644 --- a/go/pkg/qtag/generated.go +++ b/go/pkg/qtag/generated.go @@ -511,3 +511,45 @@ func (c *Sundeck) AddAuto_routing_warehouse_pool(value any) { func (c *Sundeck) AddQuery_id(value any) { c.values["query_id"] = value } + +type Walrusiq struct { + Builder + name string + identifier map[string]any + values map[string]any +} + +func NewWalrusiq() *Walrusiq { + x := Walrusiq{} + x.init() + return &x +} + +func (c *Walrusiq) init() { + c.name = "walrusiq" + c.identifier = make(map[string]any) + json.Unmarshal([]byte("{\"fields\":{\"app\":\"walrusiq\"}}"), &c.identifier) + c.values = make(map[string]any) +} + +func (c *Walrusiq) Format() (string, error) { + return format(c.name, c.identifier, c.values) +} + +func (c *Walrusiq) UnknownValue(name string, value any) { + c.values[name] = value +} + +func (c *Walrusiq) Merge(other *Walrusiq) { + for k, v := range other.values { + c.values[k] = v + } +} + +func (c *Walrusiq) AddApp(value any) { + c.values["app"] = value +} + +func (c *Walrusiq) AddSuggested_warehouse_size(value any) { + c.values["suggested_warehouse_size"] = value +} diff --git a/tests/test.yaml b/tests/test.yaml index 9172acb..8557631 100644 --- a/tests/test.yaml +++ b/tests/test.yaml @@ -227,3 +227,16 @@ key: pulseId type: DIMENSION value: null +- name: test walrusiq tags + query: | + select 1 + -- {"app": "walrusiq", "suggested_warehouse_size": "Small"} + outcome: + - source: walrusiq + key: app + value: walrusiq + type: APPLICATION + - source: walrusiq + key: suggested_warehouse_size + value: Small + type: DIMENSION