From 27f43393453f5d8a2b6a2b3b28e9c940ad0fb983 Mon Sep 17 00:00:00 2001 From: David Barroso Date: Wed, 27 Sep 2023 12:40:37 +0200 Subject: [PATCH 1/2] fix: schema: update schema with minor fixes to postgres settings --- go.mod | 2 +- go.sum | 2 ++ .../be/services/mimir/model/cuegraph_gen.go | 16 ++++++++-------- .../nhost/be/services/mimir/schema/schema.cue | 6 +++--- .../be/services/mimir/schema/schema_gen.graphqls | 8 ++++---- vendor/modules.txt | 2 +- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 907f170f8..6fe4dbd88 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-git/go-git/v5 v5.9.0 github.com/google/go-cmp v0.5.9 github.com/hashicorp/go-getter v1.7.2 - github.com/nhost/be v0.0.0-20230926093342-5b218de2929f + github.com/nhost/be v0.0.0-20230927103250-70010e0e7eac github.com/pelletier/go-toml/v2 v2.0.8 github.com/urfave/cli/v2 v2.25.7 github.com/wI2L/jsondiff v0.4.0 diff --git a/go.sum b/go.sum index ebddcf6ed..fa64d8eaa 100644 --- a/go.sum +++ b/go.sum @@ -443,6 +443,8 @@ github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/nhost/be v0.0.0-20230926093342-5b218de2929f h1:Ws9TS33VKX3w+36k18utttmAeiwFQQBNwEpTz7vLJYU= github.com/nhost/be v0.0.0-20230926093342-5b218de2929f/go.mod h1:TX+opGjg0+Q7LflEByl4E8B8hlu1huf4t2TY3YzUA9c= +github.com/nhost/be v0.0.0-20230927103250-70010e0e7eac h1:yCWxfY84DgC5oQYjFJ3s1YJ54jKphlLJlIIIRtXwbv4= +github.com/nhost/be v0.0.0-20230927103250-70010e0e7eac/go.mod h1:TX+opGjg0+Q7LflEByl4E8B8hlu1huf4t2TY3YzUA9c= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= diff --git a/vendor/github.com/nhost/be/services/mimir/model/cuegraph_gen.go b/vendor/github.com/nhost/be/services/mimir/model/cuegraph_gen.go index dd0ad0f8d..fdfaa3d3e 100644 --- a/vendor/github.com/nhost/be/services/mimir/model/cuegraph_gen.go +++ b/vendor/github.com/nhost/be/services/mimir/model/cuegraph_gen.go @@ -11683,7 +11683,7 @@ type ConfigPostgresSettings struct { CheckpointCompletionTarget *float64 `json:"checkpointCompletionTarget" toml:"checkpointCompletionTarget"` - WalBuffers *int32 `json:"walBuffers" toml:"walBuffers"` + WalBuffers *string `json:"walBuffers" toml:"walBuffers"` DefaultStatisticsTarget *int32 `json:"defaultStatisticsTarget" toml:"defaultStatisticsTarget"` @@ -11799,7 +11799,7 @@ func (o *ConfigPostgresSettings) GetCheckpointCompletionTarget() *float64 { return o.CheckpointCompletionTarget } -func (o *ConfigPostgresSettings) GetWalBuffers() *int32 { +func (o *ConfigPostgresSettings) GetWalBuffers() *string { if o == nil { o = &ConfigPostgresSettings{} } @@ -11894,7 +11894,7 @@ type ConfigPostgresSettingsUpdateInput struct { IsSetMaintenanceWorkMem bool `json:"-"` CheckpointCompletionTarget *float64 `json:"checkpointCompletionTarget,omitempty" toml:"checkpointCompletionTarget,omitempty"` IsSetCheckpointCompletionTarget bool `json:"-"` - WalBuffers *int32 `json:"walBuffers,omitempty" toml:"walBuffers,omitempty"` + WalBuffers *string `json:"walBuffers,omitempty" toml:"walBuffers,omitempty"` IsSetWalBuffers bool `json:"-"` DefaultStatisticsTarget *int32 `json:"defaultStatisticsTarget,omitempty" toml:"defaultStatisticsTarget,omitempty"` IsSetDefaultStatisticsTarget bool `json:"-"` @@ -12019,7 +12019,7 @@ func (o *ConfigPostgresSettingsUpdateInput) UnmarshalGQL(v interface{}) error { if err != nil { return err } - var x int32 + var x string if err := json.Unmarshal(b, &x); err != nil { return err } @@ -12260,7 +12260,7 @@ func (o *ConfigPostgresSettingsUpdateInput) GetCheckpointCompletionTarget() *flo return o.CheckpointCompletionTarget } -func (o *ConfigPostgresSettingsUpdateInput) GetWalBuffers() *int32 { +func (o *ConfigPostgresSettingsUpdateInput) GetWalBuffers() *string { if o == nil { o = &ConfigPostgresSettingsUpdateInput{} } @@ -12407,7 +12407,7 @@ type ConfigPostgresSettingsInsertInput struct { EffectiveCacheSize *string `json:"effectiveCacheSize,omitempty" toml:"effectiveCacheSize,omitempty"` MaintenanceWorkMem *string `json:"maintenanceWorkMem,omitempty" toml:"maintenanceWorkMem,omitempty"` CheckpointCompletionTarget *float64 `json:"checkpointCompletionTarget,omitempty" toml:"checkpointCompletionTarget,omitempty"` - WalBuffers *int32 `json:"walBuffers,omitempty" toml:"walBuffers,omitempty"` + WalBuffers *string `json:"walBuffers,omitempty" toml:"walBuffers,omitempty"` DefaultStatisticsTarget *int32 `json:"defaultStatisticsTarget,omitempty" toml:"defaultStatisticsTarget,omitempty"` RandomPageCost *float64 `json:"randomPageCost,omitempty" toml:"randomPageCost,omitempty"` EffectiveIOConcurrency *int32 `json:"effectiveIOConcurrency,omitempty" toml:"effectiveIOConcurrency,omitempty"` @@ -12456,7 +12456,7 @@ func (o *ConfigPostgresSettingsInsertInput) GetCheckpointCompletionTarget() *flo return o.CheckpointCompletionTarget } -func (o *ConfigPostgresSettingsInsertInput) GetWalBuffers() *int32 { +func (o *ConfigPostgresSettingsInsertInput) GetWalBuffers() *string { if o == nil { o = &ConfigPostgresSettingsInsertInput{} } @@ -12595,7 +12595,7 @@ type ConfigPostgresSettingsComparisonExp struct { EffectiveCacheSize *ConfigStringComparisonExp `json:"effectiveCacheSize,omitempty"` MaintenanceWorkMem *ConfigStringComparisonExp `json:"maintenanceWorkMem,omitempty"` CheckpointCompletionTarget *ConfigFloatComparisonExp `json:"checkpointCompletionTarget,omitempty"` - WalBuffers *ConfigInt32ComparisonExp `json:"walBuffers,omitempty"` + WalBuffers *ConfigStringComparisonExp `json:"walBuffers,omitempty"` DefaultStatisticsTarget *ConfigInt32ComparisonExp `json:"defaultStatisticsTarget,omitempty"` RandomPageCost *ConfigFloatComparisonExp `json:"randomPageCost,omitempty"` EffectiveIOConcurrency *ConfigInt32ComparisonExp `json:"effectiveIOConcurrency,omitempty"` diff --git a/vendor/github.com/nhost/be/services/mimir/schema/schema.cue b/vendor/github.com/nhost/be/services/mimir/schema/schema.cue index ecfe36486..dc451729a 100644 --- a/vendor/github.com/nhost/be/services/mimir/schema/schema.cue +++ b/vendor/github.com/nhost/be/services/mimir/schema/schema.cue @@ -170,7 +170,7 @@ import ( // Configuration for functions service #Functions: { node: { - version: 16 + version: 16|*18 } } @@ -178,7 +178,7 @@ import ( #Postgres: { // Version of postgres, you can see available versions in the URL below: // https://hub.docker.com/r/nhost/postgres/tags - version: string | *"14.6-20230705-1" + version: string | *"14.6-20230927-1" // Resources for the service resources?: #Resources & { @@ -191,7 +191,7 @@ import ( effectiveCacheSize: string | *"4GB" maintenanceWorkMem: string | *"64MB" checkpointCompletionTarget: number | *0.9 - walBuffers: int32 | *-1 + walBuffers: string | *"-1" defaultStatisticsTarget: int32 | *100 randomPageCost: number | *4.0 effectiveIOConcurrency: int32 | *1 diff --git a/vendor/github.com/nhost/be/services/mimir/schema/schema_gen.graphqls b/vendor/github.com/nhost/be/services/mimir/schema/schema_gen.graphqls index f4e87940a..37465f6f0 100644 --- a/vendor/github.com/nhost/be/services/mimir/schema/schema_gen.graphqls +++ b/vendor/github.com/nhost/be/services/mimir/schema/schema_gen.graphqls @@ -1881,7 +1881,7 @@ type ConfigPostgresSettings { """ """ - walBuffers: ConfigInt32 + walBuffers: String """ """ @@ -1934,7 +1934,7 @@ input ConfigPostgresSettingsUpdateInput { effectiveCacheSize: String maintenanceWorkMem: String checkpointCompletionTarget: Float - walBuffers: ConfigInt32 + walBuffers: String defaultStatisticsTarget: ConfigInt32 randomPageCost: Float effectiveIOConcurrency: ConfigInt32 @@ -1954,7 +1954,7 @@ input ConfigPostgresSettingsInsertInput { effectiveCacheSize: String maintenanceWorkMem: String checkpointCompletionTarget: Float - walBuffers: ConfigInt32 + walBuffers: String defaultStatisticsTarget: ConfigInt32 randomPageCost: Float effectiveIOConcurrency: ConfigInt32 @@ -1977,7 +1977,7 @@ input ConfigPostgresSettingsComparisonExp { effectiveCacheSize: ConfigStringComparisonExp maintenanceWorkMem: ConfigStringComparisonExp checkpointCompletionTarget: ConfigFloatComparisonExp - walBuffers: ConfigInt32ComparisonExp + walBuffers: ConfigStringComparisonExp defaultStatisticsTarget: ConfigInt32ComparisonExp randomPageCost: ConfigFloatComparisonExp effectiveIOConcurrency: ConfigInt32ComparisonExp diff --git a/vendor/modules.txt b/vendor/modules.txt index c6aa29e78..03337a107 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -399,7 +399,7 @@ github.com/muesli/reflow/wrap # github.com/muesli/termenv v0.15.2 ## explicit; go 1.17 github.com/muesli/termenv -# github.com/nhost/be v0.0.0-20230926093342-5b218de2929f +# github.com/nhost/be v0.0.0-20230927103250-70010e0e7eac ## explicit; go 1.21 github.com/nhost/be/services/mimir/model github.com/nhost/be/services/mimir/schema From 14c69927767c6b5e18fae374b8245ce6f96ebe2b Mon Sep 17 00:00:00 2001 From: David Barroso Date: Wed, 27 Sep 2023 12:49:46 +0200 Subject: [PATCH 2/2] asd --- cmd/config/example.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/config/example.go b/cmd/config/example.go index 16a4c13e8..52a2bb402 100644 --- a/cmd/config/example.go +++ b/cmd/config/example.go @@ -271,7 +271,7 @@ func commandExample(cCtx *cli.Context) error { //nolint:funlen,maintidx EffectiveCacheSize: ptr("4GB"), MaintenanceWorkMem: ptr("64MB"), CheckpointCompletionTarget: ptr(float64(0.9)), - WalBuffers: ptr(int32(-1)), + WalBuffers: ptr("-1"), DefaultStatisticsTarget: ptr(int32(100)), RandomPageCost: ptr(float64(4)), EffectiveIOConcurrency: ptr(int32(1)),