diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 84054bcaa3878..880a88b198650 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -165,7 +165,7 @@ jobs: - name: Setup sqlc uses: sqlc-dev/setup-sqlc@v3 with: - sqlc-version: "1.18.0" + sqlc-version: "1.19.1" - name: go install tools run: | diff --git a/.github/workflows/pr-deploy.yaml b/.github/workflows/pr-deploy.yaml index d9d5dc7f0fc77..0e06715aac181 100644 --- a/.github/workflows/pr-deploy.yaml +++ b/.github/workflows/pr-deploy.yaml @@ -116,7 +116,7 @@ jobs: - name: Setup sqlc uses: sqlc-dev/setup-sqlc@v3 with: - sqlc-version: "1.18.0" + sqlc-version: "1.19.1" - name: GHCR Login uses: docker/login-action@v2 diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 202a6144ad503..a703a1bb90b32 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -83,7 +83,7 @@ jobs: - name: Setup sqlc uses: sqlc-dev/setup-sqlc@v3 with: - sqlc-version: "1.18.0" + sqlc-version: "1.19.1" - name: Install yq run: go run github.com/mikefarah/yq/v4@v4.30.6 diff --git a/coderd/apikey/apikey.go b/coderd/apikey/apikey.go index a5741043ab84d..8abba96421914 100644 --- a/coderd/apikey/apikey.go +++ b/coderd/apikey/apikey.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/xerrors" "github.com/coder/coder/coderd/database" diff --git a/coderd/audit.go b/coderd/audit.go index bfcdf38e0bb31..18eb155743c0e 100644 --- a/coderd/audit.go +++ b/coderd/audit.go @@ -11,7 +11,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/xerrors" "cdr.dev/slog" diff --git a/coderd/audit/request.go b/coderd/audit/request.go index 34a148531ee02..aec89ef3d308e 100644 --- a/coderd/audit/request.go +++ b/coderd/audit/request.go @@ -10,7 +10,7 @@ import ( "strconv" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "cdr.dev/slog" "github.com/coder/coder/coderd/database" diff --git a/coderd/database/dbgen/dbgen.go b/coderd/database/dbgen/dbgen.go index 93002010d5765..23ccfe71ac61a 100644 --- a/coderd/database/dbgen/dbgen.go +++ b/coderd/database/dbgen/dbgen.go @@ -13,8 +13,8 @@ import ( "github.com/google/uuid" "github.com/moby/moby/pkg/namesgenerator" + "github.com/sqlc-dev/pqtype" "github.com/stretchr/testify/require" - "github.com/tabbed/pqtype" "github.com/coder/coder/coderd/database" "github.com/coder/coder/coderd/database/dbauthz" diff --git a/coderd/database/models.go b/coderd/database/models.go index 35ab32c134ee0..72041fb6c8a52 100644 --- a/coderd/database/models.go +++ b/coderd/database/models.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.18.0 +// sqlc v1.19.1 package database @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/lib/pq" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" ) type APIKeyScope string @@ -36,8 +36,8 @@ func (e *APIKeyScope) Scan(src interface{}) error { } type NullAPIKeyScope struct { - APIKeyScope APIKeyScope - Valid bool // Valid is true if APIKeyScope is not NULL + APIKeyScope APIKeyScope `json:"api_key_scope"` + Valid bool `json:"valid"` // Valid is true if APIKeyScope is not NULL } // Scan implements the Scanner interface. @@ -95,8 +95,8 @@ func (e *AppSharingLevel) Scan(src interface{}) error { } type NullAppSharingLevel struct { - AppSharingLevel AppSharingLevel - Valid bool // Valid is true if AppSharingLevel is not NULL + AppSharingLevel AppSharingLevel `json:"app_sharing_level"` + Valid bool `json:"valid"` // Valid is true if AppSharingLevel is not NULL } // Scan implements the Scanner interface. @@ -161,8 +161,8 @@ func (e *AuditAction) Scan(src interface{}) error { } type NullAuditAction struct { - AuditAction AuditAction - Valid bool // Valid is true if AuditAction is not NULL + AuditAction AuditAction `json:"audit_action"` + Valid bool `json:"valid"` // Valid is true if AuditAction is not NULL } // Scan implements the Scanner interface. @@ -235,8 +235,8 @@ func (e *BuildReason) Scan(src interface{}) error { } type NullBuildReason struct { - BuildReason BuildReason - Valid bool // Valid is true if BuildReason is not NULL + BuildReason BuildReason `json:"build_reason"` + Valid bool `json:"valid"` // Valid is true if BuildReason is not NULL } // Scan implements the Scanner interface. @@ -304,8 +304,8 @@ func (e *LogLevel) Scan(src interface{}) error { } type NullLogLevel struct { - LogLevel LogLevel - Valid bool // Valid is true if LogLevel is not NULL + LogLevel LogLevel `json:"log_level"` + Valid bool `json:"valid"` // Valid is true if LogLevel is not NULL } // Scan implements the Scanner interface. @@ -368,8 +368,8 @@ func (e *LogSource) Scan(src interface{}) error { } type NullLogSource struct { - LogSource LogSource - Valid bool // Valid is true if LogSource is not NULL + LogSource LogSource `json:"log_source"` + Valid bool `json:"valid"` // Valid is true if LogSource is not NULL } // Scan implements the Scanner interface. @@ -430,8 +430,8 @@ func (e *LoginType) Scan(src interface{}) error { } type NullLoginType struct { - LoginType LoginType - Valid bool // Valid is true if LoginType is not NULL + LoginType LoginType `json:"login_type"` + Valid bool `json:"valid"` // Valid is true if LoginType is not NULL } // Scan implements the Scanner interface. @@ -495,8 +495,8 @@ func (e *ParameterDestinationScheme) Scan(src interface{}) error { } type NullParameterDestinationScheme struct { - ParameterDestinationScheme ParameterDestinationScheme - Valid bool // Valid is true if ParameterDestinationScheme is not NULL + ParameterDestinationScheme ParameterDestinationScheme `json:"parameter_destination_scheme"` + Valid bool `json:"valid"` // Valid is true if ParameterDestinationScheme is not NULL } // Scan implements the Scanner interface. @@ -556,8 +556,8 @@ func (e *ParameterScope) Scan(src interface{}) error { } type NullParameterScope struct { - ParameterScope ParameterScope - Valid bool // Valid is true if ParameterScope is not NULL + ParameterScope ParameterScope `json:"parameter_scope"` + Valid bool `json:"valid"` // Valid is true if ParameterScope is not NULL } // Scan implements the Scanner interface. @@ -616,8 +616,8 @@ func (e *ParameterSourceScheme) Scan(src interface{}) error { } type NullParameterSourceScheme struct { - ParameterSourceScheme ParameterSourceScheme - Valid bool // Valid is true if ParameterSourceScheme is not NULL + ParameterSourceScheme ParameterSourceScheme `json:"parameter_source_scheme"` + Valid bool `json:"valid"` // Valid is true if ParameterSourceScheme is not NULL } // Scan implements the Scanner interface. @@ -674,8 +674,8 @@ func (e *ParameterTypeSystem) Scan(src interface{}) error { } type NullParameterTypeSystem struct { - ParameterTypeSystem ParameterTypeSystem - Valid bool // Valid is true if ParameterTypeSystem is not NULL + ParameterTypeSystem ParameterTypeSystem `json:"parameter_type_system"` + Valid bool `json:"valid"` // Valid is true if ParameterTypeSystem is not NULL } // Scan implements the Scanner interface. @@ -733,8 +733,8 @@ func (e *ProvisionerJobType) Scan(src interface{}) error { } type NullProvisionerJobType struct { - ProvisionerJobType ProvisionerJobType - Valid bool // Valid is true if ProvisionerJobType is not NULL + ProvisionerJobType ProvisionerJobType `json:"provisioner_job_type"` + Valid bool `json:"valid"` // Valid is true if ProvisionerJobType is not NULL } // Scan implements the Scanner interface. @@ -792,8 +792,8 @@ func (e *ProvisionerStorageMethod) Scan(src interface{}) error { } type NullProvisionerStorageMethod struct { - ProvisionerStorageMethod ProvisionerStorageMethod - Valid bool // Valid is true if ProvisionerStorageMethod is not NULL + ProvisionerStorageMethod ProvisionerStorageMethod `json:"provisioner_storage_method"` + Valid bool `json:"valid"` // Valid is true if ProvisionerStorageMethod is not NULL } // Scan implements the Scanner interface. @@ -848,8 +848,8 @@ func (e *ProvisionerType) Scan(src interface{}) error { } type NullProvisionerType struct { - ProvisionerType ProvisionerType - Valid bool // Valid is true if ProvisionerType is not NULL + ProvisionerType ProvisionerType `json:"provisioner_type"` + Valid bool `json:"valid"` // Valid is true if ProvisionerType is not NULL } // Scan implements the Scanner interface. @@ -916,8 +916,8 @@ func (e *ResourceType) Scan(src interface{}) error { } type NullResourceType struct { - ResourceType ResourceType - Valid bool // Valid is true if ResourceType is not NULL + ResourceType ResourceType `json:"resource_type"` + Valid bool `json:"valid"` // Valid is true if ResourceType is not NULL } // Scan implements the Scanner interface. @@ -994,8 +994,8 @@ func (e *StartupScriptBehavior) Scan(src interface{}) error { } type NullStartupScriptBehavior struct { - StartupScriptBehavior StartupScriptBehavior - Valid bool // Valid is true if StartupScriptBehavior is not NULL + StartupScriptBehavior StartupScriptBehavior `json:"startup_script_behavior"` + Valid bool `json:"valid"` // Valid is true if StartupScriptBehavior is not NULL } // Scan implements the Scanner interface. @@ -1052,8 +1052,8 @@ func (e *UserStatus) Scan(src interface{}) error { } type NullUserStatus struct { - UserStatus UserStatus - Valid bool // Valid is true if UserStatus is not NULL + UserStatus UserStatus `json:"user_status"` + Valid bool `json:"valid"` // Valid is true if UserStatus is not NULL } // Scan implements the Scanner interface. @@ -1117,8 +1117,8 @@ func (e *WorkspaceAgentLifecycleState) Scan(src interface{}) error { } type NullWorkspaceAgentLifecycleState struct { - WorkspaceAgentLifecycleState WorkspaceAgentLifecycleState - Valid bool // Valid is true if WorkspaceAgentLifecycleState is not NULL + WorkspaceAgentLifecycleState WorkspaceAgentLifecycleState `json:"workspace_agent_lifecycle_state"` + Valid bool `json:"valid"` // Valid is true if WorkspaceAgentLifecycleState is not NULL } // Scan implements the Scanner interface. @@ -1190,8 +1190,8 @@ func (e *WorkspaceAgentSubsystem) Scan(src interface{}) error { } type NullWorkspaceAgentSubsystem struct { - WorkspaceAgentSubsystem WorkspaceAgentSubsystem - Valid bool // Valid is true if WorkspaceAgentSubsystem is not NULL + WorkspaceAgentSubsystem WorkspaceAgentSubsystem `json:"workspace_agent_subsystem"` + Valid bool `json:"valid"` // Valid is true if WorkspaceAgentSubsystem is not NULL } // Scan implements the Scanner interface. @@ -1252,8 +1252,8 @@ func (e *WorkspaceAppHealth) Scan(src interface{}) error { } type NullWorkspaceAppHealth struct { - WorkspaceAppHealth WorkspaceAppHealth - Valid bool // Valid is true if WorkspaceAppHealth is not NULL + WorkspaceAppHealth WorkspaceAppHealth `json:"workspace_app_health"` + Valid bool `json:"valid"` // Valid is true if WorkspaceAppHealth is not NULL } // Scan implements the Scanner interface. @@ -1315,8 +1315,8 @@ func (e *WorkspaceTransition) Scan(src interface{}) error { } type NullWorkspaceTransition struct { - WorkspaceTransition WorkspaceTransition - Valid bool // Valid is true if WorkspaceTransition is not NULL + WorkspaceTransition WorkspaceTransition `json:"workspace_transition"` + Valid bool `json:"valid"` // Valid is true if WorkspaceTransition is not NULL } // Scan implements the Scanner interface. diff --git a/coderd/database/querier.go b/coderd/database/querier.go index 6959823a01945..64e2cb01a0edd 100644 --- a/coderd/database/querier.go +++ b/coderd/database/querier.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.18.0 +// sqlc v1.19.1 package database diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index 1cb61174b2913..92e8038590b42 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.18.0 +// sqlc v1.19.1 package database @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/lib/pq" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" ) const deleteAPIKeyByID = `-- name: DeleteAPIKeyByID :exec @@ -490,7 +490,7 @@ type GetAuditLogsOffsetRow struct { UserEmail sql.NullString `db:"user_email" json:"user_email"` UserCreatedAt sql.NullTime `db:"user_created_at" json:"user_created_at"` UserStatus NullUserStatus `db:"user_status" json:"user_status"` - UserRoles []string `db:"user_roles" json:"user_roles"` + UserRoles pq.StringArray `db:"user_roles" json:"user_roles"` UserAvatarUrl sql.NullString `db:"user_avatar_url" json:"user_avatar_url"` Count int64 `db:"count" json:"count"` } @@ -539,7 +539,7 @@ func (q *sqlQuerier) GetAuditLogsOffset(ctx context.Context, arg GetAuditLogsOff &i.UserEmail, &i.UserCreatedAt, &i.UserStatus, - pq.Array(&i.UserRoles), + &i.UserRoles, &i.UserAvatarUrl, &i.Count, ); err != nil { @@ -2370,7 +2370,7 @@ WHERE ` type GetProvisionerJobsByIDsWithQueuePositionRow struct { - ProvisionerJob ProvisionerJob `db:"provisionerjob" json:"provisionerjob"` + ProvisionerJob ProvisionerJob `db:"provisioner_job" json:"provisioner_job"` QueuePosition int64 `db:"queue_position" json:"queue_position"` QueueSize int64 `db:"queue_size" json:"queue_size"` } diff --git a/coderd/httpmw/apikey.go b/coderd/httpmw/apikey.go index 65732b0fcab92..3de05b073ced5 100644 --- a/coderd/httpmw/apikey.go +++ b/coderd/httpmw/apikey.go @@ -14,7 +14,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/oauth2" "golang.org/x/xerrors" diff --git a/coderd/httpmw/authorize_test.go b/coderd/httpmw/authorize_test.go index a0c0baaf19340..1418d0b65ffb9 100644 --- a/coderd/httpmw/authorize_test.go +++ b/coderd/httpmw/authorize_test.go @@ -12,8 +12,8 @@ import ( "github.com/go-chi/chi/v5" "github.com/google/uuid" + "github.com/sqlc-dev/pqtype" "github.com/stretchr/testify/require" - "github.com/tabbed/pqtype" "github.com/coder/coder/coderd/database" "github.com/coder/coder/coderd/database/dbtestutil" diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index 163abe1c21d33..e416c6b80b07f 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -16,7 +16,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" semconv "go.opentelemetry.io/otel/semconv/v1.14.0" "go.opentelemetry.io/otel/trace" "golang.org/x/exp/maps" diff --git a/coderd/templateversions.go b/coderd/templateversions.go index f90de5639135a..13fc4420fc7e9 100644 --- a/coderd/templateversions.go +++ b/coderd/templateversions.go @@ -13,7 +13,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/google/uuid" "github.com/moby/moby/pkg/namesgenerator" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/xerrors" "cdr.dev/slog" diff --git a/coderd/wsbuilder/wsbuilder.go b/coderd/wsbuilder/wsbuilder.go index a1f8948a25aa5..7f6d840f9db6d 100644 --- a/coderd/wsbuilder/wsbuilder.go +++ b/coderd/wsbuilder/wsbuilder.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/lib/pq" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/xerrors" "github.com/coder/coder/coderd/database" diff --git a/dogfood/Dockerfile b/dogfood/Dockerfile index 47dd89a5b3fe1..95075c63f311e 100644 --- a/dogfood/Dockerfile +++ b/dogfood/Dockerfile @@ -53,7 +53,7 @@ RUN mkdir --parents "$GOPATH" && \ # charts and values files go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.5.0 && \ # sqlc for Go code generation - go install github.com/kyleconroy/sqlc/cmd/sqlc@v1.18.0 && \ + go install github.com/kyleconroy/sqlc/cmd/sqlc@v1.19.1 && \ # gcr-cleaner-cli used by CI to prune unused images go install github.com/sethvargo/gcr-cleaner/cmd/gcr-cleaner-cli@v0.5.1 && \ # ruleguard for checking custom rules, without needing to run all of diff --git a/enterprise/audit/audittest/rand.go b/enterprise/audit/audittest/rand.go index 5bf443142ae19..c1560825f0e37 100644 --- a/enterprise/audit/audittest/rand.go +++ b/enterprise/audit/audittest/rand.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "github.com/coder/coder/coderd/database" ) diff --git a/go.mod b/go.mod index 6ebb406824020..bfcd427eaf1cd 100644 --- a/go.mod +++ b/go.mod @@ -138,10 +138,10 @@ require ( github.com/robfig/cron/v3 v3.0.1 github.com/spf13/afero v1.9.5 github.com/spf13/pflag v1.0.5 + github.com/sqlc-dev/pqtype v0.2.0 github.com/stretchr/testify v1.8.4 github.com/swaggo/http-swagger/v2 v2.0.1 github.com/swaggo/swag v1.8.6 - github.com/tabbed/pqtype v0.1.1 github.com/u-root/u-root v0.11.0 github.com/unrolled/secure v1.13.0 github.com/valyala/fasthttp v1.48.0 @@ -345,7 +345,7 @@ require ( go.opentelemetry.io/otel/metric v1.16.0 // indirect go.opentelemetry.io/proto/otlp v0.19.0 // indirect go4.org/mem v0.0.0-20210711025021-927187094b94 // indirect - golang.org/x/net v0.12.0 // indirect + golang.org/x/net v0.12.0 golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.3.0 // indirect golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect diff --git a/go.sum b/go.sum index fd47f877a2717..1d9544181ee4b 100644 --- a/go.sum +++ b/go.sum @@ -772,6 +772,8 @@ github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/sqlc-dev/pqtype v0.2.0 h1:zfzDpAxjCU0/GO7EgZ7ELUh0w28SrMSHzO3rH5Wd3is= +github.com/sqlc-dev/pqtype v0.2.0/go.mod h1:oyUjp5981ctiL9UYvj1bVvCKi8OXkCa0u645hce7CAs= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= @@ -798,8 +800,6 @@ github.com/swaggo/http-swagger/v2 v2.0.1/go.mod h1:XYhrQVIKz13CxuKD4p4kvpaRB4jJ1 github.com/swaggo/swag v1.8.6 h1:2rgOaLbonWu1PLP6G+/rYjSvPg0jQE0HtrEKuE380eg= github.com/swaggo/swag v1.8.6/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tabbed/pqtype v0.1.1 h1:PhEcb9JZ8jr7SUjJDFjRPxny0M8fkXZrxn/a9yQfoZg= -github.com/tabbed/pqtype v0.1.1/go.mod h1:HLt2kLJPcUhODQkYn3mJkMHXVsuv3Z2n5NZEeKXL0Uk= github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af h1:6yITBqGTE2lEeTPG04SN9W+iWHCRyHqlVYILiSXziwk= github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af/go.mod h1:4F09kP5F+am0jAwlQLddpoMDM+iewkxxt6nxUQ5nq5o= github.com/tailscale/certstore v0.1.1-0.20220316223106-78d6e1c49d8d h1:K3j02b5j2Iw1xoggN9B2DIEkhWGheqFOeDkdJdBrJI8=