From fde2a83454019c1fd267a8f50b39492bbb10f8e6 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 2 Nov 2023 12:43:41 -0700 Subject: [PATCH] build: Upgrade to github.com/sqlc-dev/plugin-go-sdk@v1.23.0 --- go.mod | 2 +- go.sum | 4 ++-- internal/endtoend/testdata/authors/sqlc.yaml | 3 ++- internal/field.go | 2 +- internal/gen.go | 6 +++--- internal/go_type.go | 4 ++-- internal/imports.go | 2 +- internal/mysql_type.go | 6 +++--- internal/opts/options.go | 2 +- internal/opts/override.go | 4 ++-- internal/opts/shim.go | 2 +- internal/postgresql_type.go | 6 +++--- internal/query.go | 4 ++-- internal/result.go | 8 ++++---- internal/result_test.go | 4 ++-- internal/sqlite_type.go | 4 ++-- internal/struct.go | 2 +- plugin/main.go | 2 +- 18 files changed, 34 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index 3648de2b3..e8edfb16e 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/fatih/structtag v1.2.0 github.com/google/go-cmp v0.5.9 github.com/jinzhu/inflection v1.0.0 - github.com/sqlc-dev/sqlc-go v1.22.1-0.20231102170509-ee94c710d92e + github.com/sqlc-dev/plugin-sdk-go v1.23.0 ) require ( diff --git a/go.sum b/go.sum index 92cc22af5..df3c7de29 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,8 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/sqlc-dev/sqlc-go v1.22.1-0.20231102170509-ee94c710d92e h1:fgvOWVSJLVvl1ETExPEw2okhTj2kbxvAQ5ECLrAtWbQ= -github.com/sqlc-dev/sqlc-go v1.22.1-0.20231102170509-ee94c710d92e/go.mod h1:SXs+GYtPBUfDJQWSOvcJesiAwj4HNfigK7EwzwpHNPk= +github.com/sqlc-dev/plugin-sdk-go v1.23.0 h1:iSeJhnXPlbDXlbzUEebw/DxsGzE9rdDJArl8Hvt0RMM= +github.com/sqlc-dev/plugin-sdk-go v1.23.0/go.mod h1:I1r4THOfyETD+LI2gogN2LX8wCjwUZrgy/NU4In3llA= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= diff --git a/internal/endtoend/testdata/authors/sqlc.yaml b/internal/endtoend/testdata/authors/sqlc.yaml index 8cd310dae..2bc3dd32f 100644 --- a/internal/endtoend/testdata/authors/sqlc.yaml +++ b/internal/endtoend/testdata/authors/sqlc.yaml @@ -3,6 +3,7 @@ plugins: - name: golang wasm: url: file://../../../../bin/sqlc-gen-go.wasm + sha256: 841f3b108a637b18782f7a74a4ea3e0829e572ff8287f78effa02e17f389656c sql: - schema: schema.sql queries: query.sql @@ -12,4 +13,4 @@ sql: out: go options: package: querytest - sql_package: pgx/v5 \ No newline at end of file + sql_package: pgx/v5 diff --git a/internal/field.go b/internal/field.go index cf4834274..9fec8ecb5 100644 --- a/internal/field.go +++ b/internal/field.go @@ -6,8 +6,8 @@ import ( "sort" "strings" + "github.com/sqlc-dev/plugin-sdk-go/plugin" "github.com/sqlc-dev/sqlc-gen-go/internal/opts" - "github.com/sqlc-dev/sqlc-go/plugin" ) type Field struct { diff --git a/internal/gen.go b/internal/gen.go index aacf33086..f88ae2cb5 100644 --- a/internal/gen.go +++ b/internal/gen.go @@ -10,10 +10,10 @@ import ( "strings" "text/template" + "github.com/sqlc-dev/plugin-sdk-go/metadata" + "github.com/sqlc-dev/plugin-sdk-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/sdk" "github.com/sqlc-dev/sqlc-gen-go/internal/opts" - "github.com/sqlc-dev/sqlc-go/sdk" - "github.com/sqlc-dev/sqlc-go/metadata" - "github.com/sqlc-dev/sqlc-go/plugin" ) type tmplCtx struct { diff --git a/internal/go_type.go b/internal/go_type.go index ca6622df6..920dbd3c7 100644 --- a/internal/go_type.go +++ b/internal/go_type.go @@ -3,9 +3,9 @@ package golang import ( "strings" + "github.com/sqlc-dev/plugin-sdk-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/sdk" "github.com/sqlc-dev/sqlc-gen-go/internal/opts" - "github.com/sqlc-dev/sqlc-go/sdk" - "github.com/sqlc-dev/sqlc-go/plugin" ) func addExtraGoStructTags(tags map[string]string, req *plugin.GenerateRequest, options *opts.Options, col *plugin.Column) { diff --git a/internal/imports.go b/internal/imports.go index f7cd90b06..bf10e78a8 100644 --- a/internal/imports.go +++ b/internal/imports.go @@ -5,8 +5,8 @@ import ( "sort" "strings" + "github.com/sqlc-dev/plugin-sdk-go/metadata" "github.com/sqlc-dev/sqlc-gen-go/internal/opts" - "github.com/sqlc-dev/sqlc-go/metadata" ) type fileImports struct { diff --git a/internal/mysql_type.go b/internal/mysql_type.go index faa31dd12..8b72828cd 100644 --- a/internal/mysql_type.go +++ b/internal/mysql_type.go @@ -3,10 +3,10 @@ package golang import ( "log" - "github.com/sqlc-dev/sqlc-gen-go/internal/opts" - "github.com/sqlc-dev/sqlc-go/sdk" + "github.com/sqlc-dev/plugin-sdk-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/sdk" "github.com/sqlc-dev/sqlc-gen-go/internal/debug" - "github.com/sqlc-dev/sqlc-go/plugin" + "github.com/sqlc-dev/sqlc-gen-go/internal/opts" ) func mysqlType(req *plugin.GenerateRequest, options *opts.Options, col *plugin.Column) string { diff --git a/internal/opts/options.go b/internal/opts/options.go index b5b97e363..911ccfc9e 100644 --- a/internal/opts/options.go +++ b/internal/opts/options.go @@ -5,7 +5,7 @@ import ( "fmt" "maps" - "github.com/sqlc-dev/sqlc-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/plugin" ) type Options struct { diff --git a/internal/opts/override.go b/internal/opts/override.go index 139342b80..7b5de706d 100644 --- a/internal/opts/override.go +++ b/internal/opts/override.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/sqlc-dev/sqlc-go/pattern" - "github.com/sqlc-dev/sqlc-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/pattern" + "github.com/sqlc-dev/plugin-sdk-go/plugin" ) type Override struct { diff --git a/internal/opts/shim.go b/internal/opts/shim.go index d2a59ee97..3c9f4b05f 100644 --- a/internal/opts/shim.go +++ b/internal/opts/shim.go @@ -3,7 +3,7 @@ package opts import ( "strings" - "github.com/sqlc-dev/sqlc-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/plugin" ) // The ShimOverride struct exists to bridge the gap between the Override struct diff --git a/internal/postgresql_type.go b/internal/postgresql_type.go index d4abe03f0..2d2b4e798 100644 --- a/internal/postgresql_type.go +++ b/internal/postgresql_type.go @@ -5,10 +5,10 @@ import ( "log" "strings" - "github.com/sqlc-dev/sqlc-gen-go/internal/opts" - "github.com/sqlc-dev/sqlc-go/sdk" + "github.com/sqlc-dev/plugin-sdk-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/sdk" "github.com/sqlc-dev/sqlc-gen-go/internal/debug" - "github.com/sqlc-dev/sqlc-go/plugin" + "github.com/sqlc-dev/sqlc-gen-go/internal/opts" ) func parseIdentifierString(name string) (*plugin.Identifier, error) { diff --git a/internal/query.go b/internal/query.go index b88f79f80..39fd33f64 100644 --- a/internal/query.go +++ b/internal/query.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/sqlc-dev/sqlc-go/metadata" - "github.com/sqlc-dev/sqlc-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/metadata" + "github.com/sqlc-dev/plugin-sdk-go/plugin" ) type QueryValue struct { diff --git a/internal/result.go b/internal/result.go index 338646b2f..d0ed307a0 100644 --- a/internal/result.go +++ b/internal/result.go @@ -5,11 +5,11 @@ import ( "sort" "strings" - "github.com/sqlc-dev/sqlc-gen-go/internal/opts" - "github.com/sqlc-dev/sqlc-go/sdk" + "github.com/sqlc-dev/plugin-sdk-go/metadata" + "github.com/sqlc-dev/plugin-sdk-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/sdk" "github.com/sqlc-dev/sqlc-gen-go/internal/inflection" - "github.com/sqlc-dev/sqlc-go/metadata" - "github.com/sqlc-dev/sqlc-go/plugin" + "github.com/sqlc-dev/sqlc-gen-go/internal/opts" ) func buildEnums(req *plugin.GenerateRequest, options *opts.Options) []Enum { diff --git a/internal/result_test.go b/internal/result_test.go index 1cbcb0493..be30e1e1d 100644 --- a/internal/result_test.go +++ b/internal/result_test.go @@ -3,8 +3,8 @@ package golang import ( "testing" - "github.com/sqlc-dev/sqlc-go/metadata" - "github.com/sqlc-dev/sqlc-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/metadata" + "github.com/sqlc-dev/plugin-sdk-go/plugin" ) func TestPutOutColumns_ForZeroColumns(t *testing.T) { diff --git a/internal/sqlite_type.go b/internal/sqlite_type.go index f79d3f01c..a1b50d1ee 100644 --- a/internal/sqlite_type.go +++ b/internal/sqlite_type.go @@ -4,9 +4,9 @@ import ( "log" "strings" - "github.com/sqlc-dev/sqlc-go/sdk" + "github.com/sqlc-dev/plugin-sdk-go/plugin" + "github.com/sqlc-dev/plugin-sdk-go/sdk" "github.com/sqlc-dev/sqlc-gen-go/internal/debug" - "github.com/sqlc-dev/sqlc-go/plugin" ) func sqliteType(req *plugin.GenerateRequest, col *plugin.Column) string { diff --git a/internal/struct.go b/internal/struct.go index db514e1c9..f4f3fbf83 100644 --- a/internal/struct.go +++ b/internal/struct.go @@ -5,8 +5,8 @@ import ( "unicode" "unicode/utf8" + "github.com/sqlc-dev/plugin-sdk-go/plugin" "github.com/sqlc-dev/sqlc-gen-go/internal/opts" - "github.com/sqlc-dev/sqlc-go/plugin" ) type Struct struct { diff --git a/plugin/main.go b/plugin/main.go index e85295545..5146a821f 100644 --- a/plugin/main.go +++ b/plugin/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/sqlc-dev/sqlc-go/codegen" + "github.com/sqlc-dev/plugin-sdk-go/codegen" golang "github.com/sqlc-dev/sqlc-gen-go/internal" )