Skip to content

Commit ebbc869

Browse files
Adds changeTracking member to DatasetOutboundShare
1 parent 9643168 commit ebbc869

File tree

5 files changed

+49
-17
lines changed

5 files changed

+49
-17
lines changed

client/internal/meta/operation/dataset_outbound_share.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ fragment DatasetOutboundShare on DatasetOutboundShare {
1111
schemaName
1212
viewName
1313
freshnessGoal
14+
changeTracking
1415

1516
status {
1617
state

client/internal/meta/schema/datasetoutboundshare.graphql

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ extend type Mutation {
1212
}
1313

1414
enum DatasetOutboundShareState @goModel(model: "observe/meta/metatypes.DatasetOutboundShareState") {
15-
Error
16-
Live
17-
Pending
18-
Unavailable
15+
Error
16+
Live
17+
Pending
18+
Unavailable
1919
}
2020

2121
type DatasetOutboundShareStatus @goModel(model: "observe/meta/metatypes.DatasetOutboundShareStatus") {
@@ -42,6 +42,11 @@ type DatasetOutboundShare implements WorkspaceObject & AuditedObject & FolderObj
4242
The freshness goal for the outbound share, in nanoseconds. This determines the maximum staleness for the shared dataset. Newer data may not yet be accelerated (materialized) and will not be returned in Snowflake queries for the share. To avoid additional acceleration and minimize cost, set this to 1 hour (3600000000000), the maximum staleness of datasets when freshness decay is active.
4343
"""
4444
freshnessGoal: Int64!
45+
"""
46+
If set to true, the shared view will have change tracking enabled.
47+
"""
48+
changeTracking: Boolean
49+
4550
# WorkspaceObject
4651
id: ObjectId!
4752
workspaceId: ObjectId!
@@ -71,6 +76,10 @@ input DatasetOutboundShareInput @goModel(model: "observe/meta/metatypes.DatasetO
7176
viewName: String!
7277
# resolver: status: DatasetOutboundShareStatusInput!
7378
freshnessGoal: Int64!
79+
"""
80+
If set to true, the shared view will have change tracking enabled.
81+
"""
82+
changeTracking: Boolean
7483
# WorkspaceObject
7584
name: String!
7685
iconUrl: String

client/meta/genqlient.generated.go

Lines changed: 20 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/resources/dataset_outbound_share.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ resource "observe_dataset_outbound_share" "example" {
5757

5858
### Optional
5959

60+
- `change_tracking` (Boolean) If set to true, the shared view will have change tracking enabled.
6061
- `description` (String) A description of the dataset sharing configuration.
6162
- `folder` (String)
6263
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

observe/resource_dataset_outbound_share.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import (
99
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1010
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
12-
1312
observe "github.com/observeinc/terraform-provider-observe/client"
1413
gql "github.com/observeinc/terraform-provider-observe/client/meta"
1514
"github.com/observeinc/terraform-provider-observe/client/meta/types"
16-
1715
"github.com/observeinc/terraform-provider-observe/client/oid"
1816
"github.com/observeinc/terraform-provider-observe/observe/descriptions"
1917
)
@@ -91,6 +89,11 @@ func resourceDatasetOutboundShare() *schema.Resource {
9189
ValidateDiagFunc: validateTimeDuration,
9290
DiffSuppressFunc: diffSuppressTimeDuration,
9391
},
92+
"change_tracking": {
93+
Type: schema.TypeBool,
94+
Optional: true,
95+
Description: "If set to true, the shared view will have change tracking enabled.",
96+
},
9497
},
9598
}
9699
}
@@ -102,10 +105,11 @@ func newDatasetOutboundShare(d *schema.ResourceData) (*gql.DatasetOutboundShareI
102105
}
103106

104107
input := &gql.DatasetOutboundShareInput{
105-
Name: d.Get("name").(string),
106-
SchemaName: d.Get("schema_name").(string),
107-
ViewName: d.Get("view_name").(string),
108-
FreshnessGoal: types.Int64Scalar(freshnessGoal),
108+
Name: d.Get("name").(string),
109+
SchemaName: d.Get("schema_name").(string),
110+
ViewName: d.Get("view_name").(string),
111+
FreshnessGoal: types.Int64Scalar(freshnessGoal),
112+
ChangeTracking: boolPtr(d.Get("change_tracking").(bool)),
109113
}
110114

111115
if v, ok := d.GetOk("description"); ok {
@@ -247,6 +251,10 @@ func resourceDatasetOutboundShareRead(ctx context.Context, d *schema.ResourceDat
247251
diags = append(diags, diag.FromErr(err)...)
248252
}
249253

254+
if err := d.Set("change_tracking", datasetShare.ChangeTracking); err != nil {
255+
diags = append(diags, diag.FromErr(err)...)
256+
}
257+
250258
return diags
251259
}
252260

0 commit comments

Comments
 (0)