From a70c5e5d421887087ffa591bfb80e202acb90533 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Wed, 29 Oct 2025 14:19:55 +0200 Subject: [PATCH 1/2] Update import paths to github.com/coder/sqlc (#2) --- cmd/sqlc-gen-json/main.go | 4 +-- cmd/sqlc/main.go | 2 +- examples/authors/mysql/db_test.go | 2 +- examples/authors/postgresql/db_test.go | 2 +- examples/authors/sqlite/db_test.go | 2 +- examples/batch/postgresql/db_test.go | 2 +- examples/booktest/mysql/db_test.go | 2 +- examples/booktest/postgresql/db_test.go | 2 +- examples/booktest/sqlite/db_test.go | 2 +- examples/ondeck/mysql/db_test.go | 2 +- examples/ondeck/postgresql/db_test.go | 2 +- examples/ondeck/sqlite/db_test.go | 2 +- go.mod | 2 +- internal/analyzer/analyzer.go | 12 ++++---- internal/bundler/multipart.go | 4 +-- internal/bundler/upload.go | 10 +++---- internal/cmd/cmd.go | 10 +++---- internal/cmd/createdb.go | 8 ++--- internal/cmd/generate.go | 30 +++++++++---------- internal/cmd/options.go | 2 +- internal/cmd/process.go | 8 ++--- internal/cmd/push.go | 6 ++-- internal/cmd/shim.go | 12 ++++---- internal/cmd/verify.go | 14 ++++----- internal/cmd/vet.go | 22 +++++++------- internal/codegen/golang/driver.go | 2 +- internal/codegen/golang/field.go | 4 +-- internal/codegen/golang/gen.go | 8 ++--- internal/codegen/golang/go_type.go | 6 ++-- internal/codegen/golang/imports.go | 4 +-- internal/codegen/golang/mysql_type.go | 8 ++--- internal/codegen/golang/opts/options.go | 2 +- internal/codegen/golang/opts/override.go | 8 ++--- internal/codegen/golang/opts/shim.go | 2 +- internal/codegen/golang/postgresql_type.go | 8 ++--- internal/codegen/golang/query.go | 6 ++-- internal/codegen/golang/result.go | 10 +++---- internal/codegen/golang/result_test.go | 4 +-- internal/codegen/golang/sqlite_type.go | 8 ++--- internal/codegen/golang/struct.go | 4 +-- internal/codegen/json/gen.go | 2 +- internal/codegen/sdk/sdk.go | 4 +-- internal/compiler/analyze.go | 14 ++++----- internal/compiler/compat.go | 4 +-- internal/compiler/compile.go | 16 +++++----- internal/compiler/engine.go | 18 +++++------ internal/compiler/expand.go | 8 ++--- internal/compiler/find_params.go | 4 +-- internal/compiler/output_columns.go | 10 +++---- internal/compiler/parse.go | 14 ++++----- internal/compiler/query.go | 6 ++-- internal/compiler/query_catalog.go | 6 ++-- internal/compiler/resolve.go | 12 ++++---- internal/compiler/result.go | 2 +- internal/compiler/to_column.go | 4 +-- internal/config/config.go | 2 +- internal/config/v_one.go | 2 +- internal/dbmanager/client.go | 6 ++-- internal/debug/dump.go | 2 +- internal/endtoend/ddl_test.go | 4 +-- internal/endtoend/endtoend_test.go | 8 ++--- internal/endtoend/fmt_test.go | 6 ++-- .../testdata/overrides/mysql/go/models.go | 2 +- .../overrides/postgresql/pgx/v4/go/models.go | 2 +- .../overrides/postgresql/pgx/v5/go/models.go | 2 +- .../overrides/postgresql/stdlib/go/models.go | 2 +- .../testdata/overrides/sqlite/go/models.go | 2 +- .../v2/yaml/global/db/models.go | 2 +- .../v2/yaml/global_and_queryset/db/models.go | 2 +- .../v2/yaml/queryset/db/models.go | 2 +- .../overrides_go_types/mysql/go/models.go | 2 +- .../overrides_go_types/mysql/go/query.sql.go | 2 +- .../overrides_go_types/sqlite/go/models.go | 2 +- .../postgresql/pgx/v4/go/query.sql.go | 2 +- .../postgresql/pgx/v5/go/query.sql.go | 2 +- .../postgresql/stdlib/go/query.sql.go | 2 +- .../testdata/sqlc_slice/mysql/go/models.go | 2 +- .../testdata/sqlc_slice/mysql/go/query.sql.go | 2 +- .../testdata/yaml_overrides/go/models.go | 2 +- internal/endtoend/vet_test.go | 6 ++-- internal/engine/dolphin/catalog.go | 2 +- internal/engine/dolphin/convert.go | 4 +-- internal/engine/dolphin/parse.go | 6 ++-- internal/engine/dolphin/stdlib.go | 4 +-- internal/engine/dolphin/utils.go | 2 +- .../engine/postgresql/analyzer/analyze.go | 16 +++++----- internal/engine/postgresql/catalog.go | 2 +- internal/engine/postgresql/catalog_test.go | 2 +- .../engine/postgresql/contrib/adminpack.go | 4 +-- internal/engine/postgresql/contrib/amcheck.go | 4 +-- .../engine/postgresql/contrib/btree_gin.go | 4 +-- .../engine/postgresql/contrib/btree_gist.go | 4 +-- internal/engine/postgresql/contrib/citext.go | 4 +-- internal/engine/postgresql/contrib/cube.go | 4 +-- internal/engine/postgresql/contrib/dblink.go | 4 +-- .../postgresql/contrib/earthdistance.go | 4 +-- .../engine/postgresql/contrib/file_fdw.go | 4 +-- .../postgresql/contrib/fuzzystrmatch.go | 4 +-- internal/engine/postgresql/contrib/hstore.go | 4 +-- internal/engine/postgresql/contrib/intagg.go | 4 +-- .../engine/postgresql/contrib/intarray.go | 4 +-- internal/engine/postgresql/contrib/isn.go | 4 +-- internal/engine/postgresql/contrib/lo.go | 4 +-- internal/engine/postgresql/contrib/ltree.go | 4 +-- .../engine/postgresql/contrib/pageinspect.go | 4 +-- .../postgresql/contrib/pg_buffercache.go | 4 +-- .../postgresql/contrib/pg_freespacemap.go | 4 +-- .../engine/postgresql/contrib/pg_prewarm.go | 4 +-- .../postgresql/contrib/pg_stat_statements.go | 4 +-- internal/engine/postgresql/contrib/pg_trgm.go | 4 +-- .../postgresql/contrib/pg_visibility.go | 4 +-- .../engine/postgresql/contrib/pgcrypto.go | 4 +-- .../engine/postgresql/contrib/pgrowlocks.go | 4 +-- .../engine/postgresql/contrib/pgstattuple.go | 4 +-- .../engine/postgresql/contrib/postgres_fdw.go | 4 +-- internal/engine/postgresql/contrib/seg.go | 4 +-- internal/engine/postgresql/contrib/sslinfo.go | 4 +-- .../engine/postgresql/contrib/tablefunc.go | 4 +-- internal/engine/postgresql/contrib/tcn.go | 4 +-- .../engine/postgresql/contrib/unaccent.go | 4 +-- .../engine/postgresql/contrib/uuid_ossp.go | 4 +-- internal/engine/postgresql/contrib/xml2.go | 4 +-- internal/engine/postgresql/convert.go | 2 +- internal/engine/postgresql/extension.go | 4 +-- .../engine/postgresql/information_schema.go | 4 +-- internal/engine/postgresql/parse.go | 8 ++--- internal/engine/postgresql/pg_catalog.go | 4 +-- internal/engine/postgresql/pg_temp.go | 2 +- internal/engine/postgresql/rewrite_test.go | 4 +-- internal/engine/sqlite/catalog.go | 2 +- internal/engine/sqlite/catalog_test.go | 4 +-- internal/engine/sqlite/convert.go | 6 ++-- internal/engine/sqlite/parse.go | 6 ++-- internal/engine/sqlite/stdlib.go | 4 +-- internal/engine/sqlite/utils.go | 4 +-- internal/ext/handler.go | 2 +- internal/ext/process/gen.go | 2 +- internal/ext/wasm/wasm.go | 8 ++--- internal/inflection/singular.go | 6 ++-- internal/metadata/meta.go | 4 +-- internal/multierr/error.go | 4 +-- internal/quickdb/rpc.go | 6 ++-- internal/remote/rpc.go | 4 +-- internal/sql/ast/print.go | 2 +- internal/sql/astutils/join.go | 2 +- internal/sql/astutils/rewrite.go | 2 +- internal/sql/astutils/search.go | 2 +- internal/sql/astutils/walk.go | 2 +- internal/sql/catalog/catalog.go | 2 +- internal/sql/catalog/comment_on.go | 4 +-- internal/sql/catalog/extension.go | 2 +- internal/sql/catalog/func.go | 4 +-- internal/sql/catalog/public.go | 4 +-- internal/sql/catalog/schema.go | 4 +-- internal/sql/catalog/table.go | 4 +-- internal/sql/catalog/types.go | 4 +-- internal/sql/catalog/view.go | 4 +-- internal/sql/info/info.go | 2 +- internal/sql/named/is.go | 4 +-- internal/sql/rewrite/embeds.go | 4 +-- internal/sql/rewrite/parameters.go | 10 +++---- internal/sql/sqlpath/read.go | 2 +- internal/sql/validate/cmd.go | 8 ++--- internal/sql/validate/func_call.go | 10 +++---- internal/sql/validate/in.go | 8 ++--- internal/sql/validate/insert_stmt.go | 4 +-- internal/sql/validate/param_ref.go | 6 ++-- internal/sql/validate/param_style.go | 6 ++-- internal/sqltest/local/mysql.go | 6 ++-- internal/sqltest/local/postgres.go | 8 ++--- internal/sqltest/mysql.go | 2 +- internal/sqltest/pgx.go | 2 +- internal/sqltest/postgres.go | 2 +- internal/sqltest/sqlite.go | 2 +- internal/tools/sqlc-pg-gen/main.go | 8 ++--- internal/tools/sqlc-pg-gen/proc.go | 2 +- internal/tracer/trace.go | 2 +- pkg/cli/cli.go | 4 +-- placeholder.go | 2 +- scripts/build/main.go | 2 +- scripts/mirror-go-plugin/main.go | 20 ++++++------- scripts/release.go | 2 +- 182 files changed, 439 insertions(+), 439 deletions(-) diff --git a/cmd/sqlc-gen-json/main.go b/cmd/sqlc-gen-json/main.go index 05c804d082..efef5a5b0c 100644 --- a/cmd/sqlc-gen-json/main.go +++ b/cmd/sqlc-gen-json/main.go @@ -7,8 +7,8 @@ import ( "io" "os" - "github.com/sqlc-dev/sqlc/internal/codegen/json" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/json" + "github.com/coder/sqlc/internal/plugin" "google.golang.org/protobuf/proto" ) diff --git a/cmd/sqlc/main.go b/cmd/sqlc/main.go index f003db4846..9effdce5a5 100644 --- a/cmd/sqlc/main.go +++ b/cmd/sqlc/main.go @@ -3,7 +3,7 @@ package main import ( "os" - "github.com/sqlc-dev/sqlc/internal/cmd" + "github.com/coder/sqlc/internal/cmd" ) func main() { diff --git a/examples/authors/mysql/db_test.go b/examples/authors/mysql/db_test.go index 96ec363f77..4bbede1c21 100644 --- a/examples/authors/mysql/db_test.go +++ b/examples/authors/mysql/db_test.go @@ -9,7 +9,7 @@ import ( _ "github.com/go-sql-driver/mysql" - "github.com/sqlc-dev/sqlc/internal/sqltest/local" + "github.com/coder/sqlc/internal/sqltest/local" ) func TestAuthors(t *testing.T) { diff --git a/examples/authors/postgresql/db_test.go b/examples/authors/postgresql/db_test.go index 0fdd8824be..6166186090 100644 --- a/examples/authors/postgresql/db_test.go +++ b/examples/authors/postgresql/db_test.go @@ -9,7 +9,7 @@ import ( "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgtype" - "github.com/sqlc-dev/sqlc/internal/sqltest/local" + "github.com/coder/sqlc/internal/sqltest/local" ) func TestAuthors(t *testing.T) { diff --git a/examples/authors/sqlite/db_test.go b/examples/authors/sqlite/db_test.go index e10ce46069..d731ec824d 100644 --- a/examples/authors/sqlite/db_test.go +++ b/examples/authors/sqlite/db_test.go @@ -7,7 +7,7 @@ import ( "database/sql" "testing" - "github.com/sqlc-dev/sqlc/internal/sqltest" + "github.com/coder/sqlc/internal/sqltest" ) func TestAuthors(t *testing.T) { diff --git a/examples/batch/postgresql/db_test.go b/examples/batch/postgresql/db_test.go index 122fa1aa73..c33e1fd9c0 100644 --- a/examples/batch/postgresql/db_test.go +++ b/examples/batch/postgresql/db_test.go @@ -10,7 +10,7 @@ import ( "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgtype" - "github.com/sqlc-dev/sqlc/internal/sqltest/local" + "github.com/coder/sqlc/internal/sqltest/local" ) func TestBatchBooks(t *testing.T) { diff --git a/examples/booktest/mysql/db_test.go b/examples/booktest/mysql/db_test.go index 6f97178c94..83f6254564 100644 --- a/examples/booktest/mysql/db_test.go +++ b/examples/booktest/mysql/db_test.go @@ -10,7 +10,7 @@ import ( _ "github.com/go-sql-driver/mysql" - "github.com/sqlc-dev/sqlc/internal/sqltest/local" + "github.com/coder/sqlc/internal/sqltest/local" ) func TestBooks(t *testing.T) { diff --git a/examples/booktest/postgresql/db_test.go b/examples/booktest/postgresql/db_test.go index ae71593852..17338afcbc 100644 --- a/examples/booktest/postgresql/db_test.go +++ b/examples/booktest/postgresql/db_test.go @@ -10,7 +10,7 @@ import ( "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgtype" - "github.com/sqlc-dev/sqlc/internal/sqltest/local" + "github.com/coder/sqlc/internal/sqltest/local" ) func TestBooks(t *testing.T) { diff --git a/examples/booktest/sqlite/db_test.go b/examples/booktest/sqlite/db_test.go index 42a8b396b1..91bf7740df 100644 --- a/examples/booktest/sqlite/db_test.go +++ b/examples/booktest/sqlite/db_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/sqlc-dev/sqlc/internal/sqltest" + "github.com/coder/sqlc/internal/sqltest" ) // TODO: Enum is not yet supported diff --git a/examples/ondeck/mysql/db_test.go b/examples/ondeck/mysql/db_test.go index 6ac70aaf06..b03276b682 100644 --- a/examples/ondeck/mysql/db_test.go +++ b/examples/ondeck/mysql/db_test.go @@ -11,7 +11,7 @@ import ( _ "github.com/go-sql-driver/mysql" "github.com/google/go-cmp/cmp" - "github.com/sqlc-dev/sqlc/internal/sqltest/local" + "github.com/coder/sqlc/internal/sqltest/local" ) func join(vals ...string) sql.NullString { diff --git a/examples/ondeck/postgresql/db_test.go b/examples/ondeck/postgresql/db_test.go index 6d2fba6714..bab43ff8e6 100644 --- a/examples/ondeck/postgresql/db_test.go +++ b/examples/ondeck/postgresql/db_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/go-cmp/cmp" _ "github.com/lib/pq" - "github.com/sqlc-dev/sqlc/internal/sqltest/local" + "github.com/coder/sqlc/internal/sqltest/local" ) func runOnDeckQueries(t *testing.T, q *Queries) { diff --git a/examples/ondeck/sqlite/db_test.go b/examples/ondeck/sqlite/db_test.go index e4bb4e4195..510c84e7e2 100644 --- a/examples/ondeck/sqlite/db_test.go +++ b/examples/ondeck/sqlite/db_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/sqlc-dev/sqlc/internal/sqltest" + "github.com/coder/sqlc/internal/sqltest" "github.com/google/go-cmp/cmp" ) diff --git a/go.mod b/go.mod index e0f585b9fd..3a49f03ea3 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/sqlc-dev/sqlc +module github.com/coder/sqlc go 1.24.0 diff --git a/internal/analyzer/analyzer.go b/internal/analyzer/analyzer.go index 3d7e3a0287..d3e349dfa7 100644 --- a/internal/analyzer/analyzer.go +++ b/internal/analyzer/analyzer.go @@ -11,12 +11,12 @@ import ( "google.golang.org/protobuf/proto" - "github.com/sqlc-dev/sqlc/internal/analysis" - "github.com/sqlc-dev/sqlc/internal/cache" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/info" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/named" + "github.com/coder/sqlc/internal/analysis" + "github.com/coder/sqlc/internal/cache" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/info" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/named" ) type CachedAnalyzer struct { diff --git a/internal/bundler/multipart.go b/internal/bundler/multipart.go index b1d1925fde..68e3fb12e6 100644 --- a/internal/bundler/multipart.go +++ b/internal/bundler/multipart.go @@ -4,8 +4,8 @@ import ( "os" "path/filepath" - pb "github.com/sqlc-dev/sqlc/internal/quickdb/v1" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" + pb "github.com/coder/sqlc/internal/quickdb/v1" + "github.com/coder/sqlc/internal/sql/sqlpath" ) func readFiles(dir string, paths []string) ([]*pb.File, error) { diff --git a/internal/bundler/upload.go b/internal/bundler/upload.go index 49e3b44a4c..232037d62d 100644 --- a/internal/bundler/upload.go +++ b/internal/bundler/upload.go @@ -10,11 +10,11 @@ import ( "google.golang.org/protobuf/proto" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/info" - "github.com/sqlc-dev/sqlc/internal/plugin" - "github.com/sqlc-dev/sqlc/internal/quickdb" - pb "github.com/sqlc-dev/sqlc/internal/quickdb/v1" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/info" + "github.com/coder/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/quickdb" + pb "github.com/coder/sqlc/internal/quickdb/v1" ) var ErrNoProject = errors.New(`project uploads require a cloud project diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index 93fd6bbeaa..44c3a0d65b 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -17,11 +17,11 @@ import ( "github.com/spf13/pflag" "gopkg.in/yaml.v3" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/info" - "github.com/sqlc-dev/sqlc/internal/opts" - "github.com/sqlc-dev/sqlc/internal/tracer" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/info" + "github.com/coder/sqlc/internal/opts" + "github.com/coder/sqlc/internal/tracer" ) func init() { diff --git a/internal/cmd/createdb.go b/internal/cmd/createdb.go index 02b3031352..e07a67961c 100644 --- a/internal/cmd/createdb.go +++ b/internal/cmd/createdb.go @@ -8,10 +8,10 @@ import ( "time" "github.com/spf13/cobra" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/dbmanager" - "github.com/sqlc-dev/sqlc/internal/migrations" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/dbmanager" + "github.com/coder/sqlc/internal/migrations" + "github.com/coder/sqlc/internal/sql/sqlpath" ) var createDBCmd = &cobra.Command{ diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index 00e8871c7e..b87eeb76b5 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -15,21 +15,21 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/status" - "github.com/sqlc-dev/sqlc/internal/codegen/golang" - genjson "github.com/sqlc-dev/sqlc/internal/codegen/json" - "github.com/sqlc-dev/sqlc/internal/compiler" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/config/convert" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/ext" - "github.com/sqlc-dev/sqlc/internal/ext/process" - "github.com/sqlc-dev/sqlc/internal/ext/wasm" - "github.com/sqlc-dev/sqlc/internal/info" - "github.com/sqlc-dev/sqlc/internal/multierr" - "github.com/sqlc-dev/sqlc/internal/opts" - "github.com/sqlc-dev/sqlc/internal/plugin" - "github.com/sqlc-dev/sqlc/internal/remote" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/codegen/golang" + genjson "github.com/coder/sqlc/internal/codegen/json" + "github.com/coder/sqlc/internal/compiler" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/config/convert" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/ext" + "github.com/coder/sqlc/internal/ext/process" + "github.com/coder/sqlc/internal/ext/wasm" + "github.com/coder/sqlc/internal/info" + "github.com/coder/sqlc/internal/multierr" + "github.com/coder/sqlc/internal/opts" + "github.com/coder/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/remote" + "github.com/coder/sqlc/internal/sql/sqlpath" ) const errMessageNoVersion = `The configuration file must have a version number. diff --git a/internal/cmd/options.go b/internal/cmd/options.go index 02d3614f4e..973f9ebe6b 100644 --- a/internal/cmd/options.go +++ b/internal/cmd/options.go @@ -3,7 +3,7 @@ package cmd import ( "io" - "github.com/sqlc-dev/sqlc/internal/config" + "github.com/coder/sqlc/internal/config" ) type Options struct { diff --git a/internal/cmd/process.go b/internal/cmd/process.go index 5003d113b8..2ab6383859 100644 --- a/internal/cmd/process.go +++ b/internal/cmd/process.go @@ -11,10 +11,10 @@ import ( "golang.org/x/sync/errgroup" - "github.com/sqlc-dev/sqlc/internal/compiler" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/opts" + "github.com/coder/sqlc/internal/compiler" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/opts" ) type OutputPair struct { diff --git a/internal/cmd/push.go b/internal/cmd/push.go index 19aca6739b..0a854e92d2 100644 --- a/internal/cmd/push.go +++ b/internal/cmd/push.go @@ -8,9 +8,9 @@ import ( "github.com/spf13/cobra" - "github.com/sqlc-dev/sqlc/internal/bundler" - "github.com/sqlc-dev/sqlc/internal/compiler" - "github.com/sqlc-dev/sqlc/internal/config" + "github.com/coder/sqlc/internal/bundler" + "github.com/coder/sqlc/internal/compiler" + "github.com/coder/sqlc/internal/config" ) func init() { diff --git a/internal/cmd/shim.go b/internal/cmd/shim.go index 654500429a..d83d2a8d94 100644 --- a/internal/cmd/shim.go +++ b/internal/cmd/shim.go @@ -1,12 +1,12 @@ package cmd import ( - "github.com/sqlc-dev/sqlc/internal/compiler" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/config/convert" - "github.com/sqlc-dev/sqlc/internal/info" - "github.com/sqlc-dev/sqlc/internal/plugin" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/compiler" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/config/convert" + "github.com/coder/sqlc/internal/info" + "github.com/coder/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/sql/catalog" ) func pluginSettings(r *compiler.Result, cs config.CombinedSettings) *plugin.Settings { diff --git a/internal/cmd/verify.go b/internal/cmd/verify.go index a52c218bff..8a183510a4 100644 --- a/internal/cmd/verify.go +++ b/internal/cmd/verify.go @@ -12,13 +12,13 @@ import ( "github.com/spf13/cobra" "google.golang.org/protobuf/proto" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/dbmanager" - "github.com/sqlc-dev/sqlc/internal/migrations" - "github.com/sqlc-dev/sqlc/internal/plugin" - "github.com/sqlc-dev/sqlc/internal/quickdb" - pb "github.com/sqlc-dev/sqlc/internal/quickdb/v1" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/dbmanager" + "github.com/coder/sqlc/internal/migrations" + "github.com/coder/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/quickdb" + pb "github.com/coder/sqlc/internal/quickdb/v1" + "github.com/coder/sqlc/internal/sql/sqlpath" ) func init() { diff --git a/internal/cmd/vet.go b/internal/cmd/vet.go index fe3ece38f3..c6e84a0cba 100644 --- a/internal/cmd/vet.go +++ b/internal/cmd/vet.go @@ -6,7 +6,7 @@ import ( "encoding/json" "errors" "fmt" - "github.com/sqlc-dev/sqlc/internal/constants" + "github.com/coder/sqlc/internal/constants" "io" "log" "os" @@ -24,16 +24,16 @@ import ( "github.com/spf13/cobra" "google.golang.org/protobuf/encoding/protojson" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/dbmanager" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/migrations" - "github.com/sqlc-dev/sqlc/internal/opts" - "github.com/sqlc-dev/sqlc/internal/plugin" - "github.com/sqlc-dev/sqlc/internal/quickdb" - "github.com/sqlc-dev/sqlc/internal/shfmt" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" - "github.com/sqlc-dev/sqlc/internal/vet" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/dbmanager" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/migrations" + "github.com/coder/sqlc/internal/opts" + "github.com/coder/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/quickdb" + "github.com/coder/sqlc/internal/shfmt" + "github.com/coder/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/vet" ) var ErrFailedChecks = errors.New("failed checks") diff --git a/internal/codegen/golang/driver.go b/internal/codegen/golang/driver.go index 5e3a533dcc..544dac7e6b 100644 --- a/internal/codegen/golang/driver.go +++ b/internal/codegen/golang/driver.go @@ -1,6 +1,6 @@ package golang -import "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" +import "github.com/coder/sqlc/internal/codegen/golang/opts" func parseDriver(sqlPackage string) opts.SQLDriver { switch sqlPackage { diff --git a/internal/codegen/golang/field.go b/internal/codegen/golang/field.go index 2a63b6d342..f9f8c282e5 100644 --- a/internal/codegen/golang/field.go +++ b/internal/codegen/golang/field.go @@ -6,8 +6,8 @@ import ( "sort" "strings" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/plugin" ) type Field struct { diff --git a/internal/codegen/golang/gen.go b/internal/codegen/golang/gen.go index 7df56a0a41..8b6d2502c4 100644 --- a/internal/codegen/golang/gen.go +++ b/internal/codegen/golang/gen.go @@ -10,10 +10,10 @@ import ( "strings" "text/template" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/codegen/sdk" - "github.com/sqlc-dev/sqlc/internal/metadata" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/codegen/sdk" + "github.com/coder/sqlc/internal/metadata" + "github.com/coder/sqlc/internal/plugin" ) type tmplCtx struct { diff --git a/internal/codegen/golang/go_type.go b/internal/codegen/golang/go_type.go index c4aac84dd6..574c9c96ac 100644 --- a/internal/codegen/golang/go_type.go +++ b/internal/codegen/golang/go_type.go @@ -3,9 +3,9 @@ package golang import ( "strings" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/codegen/sdk" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/codegen/sdk" + "github.com/coder/sqlc/internal/plugin" ) func addExtraGoStructTags(tags map[string]string, req *plugin.GenerateRequest, options *opts.Options, col *plugin.Column) { diff --git a/internal/codegen/golang/imports.go b/internal/codegen/golang/imports.go index ccca4f603c..3cfad8d40a 100644 --- a/internal/codegen/golang/imports.go +++ b/internal/codegen/golang/imports.go @@ -5,8 +5,8 @@ import ( "sort" "strings" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/metadata" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/metadata" ) type fileImports struct { diff --git a/internal/codegen/golang/mysql_type.go b/internal/codegen/golang/mysql_type.go index b8e8aa43c7..3a7243e32c 100644 --- a/internal/codegen/golang/mysql_type.go +++ b/internal/codegen/golang/mysql_type.go @@ -3,10 +3,10 @@ package golang import ( "log" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/codegen/sdk" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/codegen/sdk" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/plugin" ) func mysqlType(req *plugin.GenerateRequest, options *opts.Options, col *plugin.Column) string { diff --git a/internal/codegen/golang/opts/options.go b/internal/codegen/golang/opts/options.go index 0d5d51c2dd..32779124da 100644 --- a/internal/codegen/golang/opts/options.go +++ b/internal/codegen/golang/opts/options.go @@ -6,7 +6,7 @@ import ( "maps" "path/filepath" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/plugin" ) type Options struct { diff --git a/internal/codegen/golang/opts/override.go b/internal/codegen/golang/opts/override.go index 6916c0c7f3..ae1b6ea762 100644 --- a/internal/codegen/golang/opts/override.go +++ b/internal/codegen/golang/opts/override.go @@ -5,9 +5,9 @@ import ( "os" "strings" - "github.com/sqlc-dev/sqlc/internal/codegen/sdk" - "github.com/sqlc-dev/sqlc/internal/pattern" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/sdk" + "github.com/coder/sqlc/internal/pattern" + "github.com/coder/sqlc/internal/plugin" ) type Override struct { @@ -15,7 +15,7 @@ type Override struct { GoType GoType `json:"go_type" yaml:"go_type"` // additional Go struct tags to add to this field, in raw Go struct tag form, e.g. `validate:"required" x:"y,z"` - // see https://github.com/sqlc-dev/sqlc/issues/534 + // see https://github.com/coder/sqlc/issues/534 GoStructTag GoStructTag `json:"go_struct_tag" yaml:"go_struct_tag"` // fully qualified name of the Go type, e.g. `github.com/segmentio/ksuid.KSUID` diff --git a/internal/codegen/golang/opts/shim.go b/internal/codegen/golang/opts/shim.go index 7912e17664..f17b177fe4 100644 --- a/internal/codegen/golang/opts/shim.go +++ b/internal/codegen/golang/opts/shim.go @@ -3,7 +3,7 @@ package opts import ( "strings" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/plugin" ) // The ShimOverride struct exists to bridge the gap between the Override struct diff --git a/internal/codegen/golang/postgresql_type.go b/internal/codegen/golang/postgresql_type.go index 398d01e2e8..74a9ef1ad1 100644 --- a/internal/codegen/golang/postgresql_type.go +++ b/internal/codegen/golang/postgresql_type.go @@ -5,10 +5,10 @@ import ( "log" "strings" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/codegen/sdk" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/codegen/sdk" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/plugin" ) func parseIdentifierString(name string) (*plugin.Identifier, error) { diff --git a/internal/codegen/golang/query.go b/internal/codegen/golang/query.go index 3b4fb2fa1a..fd1d4dae35 100644 --- a/internal/codegen/golang/query.go +++ b/internal/codegen/golang/query.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/metadata" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/metadata" + "github.com/coder/sqlc/internal/plugin" ) type QueryValue struct { diff --git a/internal/codegen/golang/result.go b/internal/codegen/golang/result.go index 515d0a654f..0ea72c76f7 100644 --- a/internal/codegen/golang/result.go +++ b/internal/codegen/golang/result.go @@ -6,11 +6,11 @@ import ( "sort" "strings" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/codegen/sdk" - "github.com/sqlc-dev/sqlc/internal/inflection" - "github.com/sqlc-dev/sqlc/internal/metadata" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/codegen/sdk" + "github.com/coder/sqlc/internal/inflection" + "github.com/coder/sqlc/internal/metadata" + "github.com/coder/sqlc/internal/plugin" ) func buildEnums(req *plugin.GenerateRequest, options *opts.Options) []Enum { diff --git a/internal/codegen/golang/result_test.go b/internal/codegen/golang/result_test.go index 0c58525ec3..124f019c0d 100644 --- a/internal/codegen/golang/result_test.go +++ b/internal/codegen/golang/result_test.go @@ -3,8 +3,8 @@ package golang import ( "testing" - "github.com/sqlc-dev/sqlc/internal/metadata" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/metadata" + "github.com/coder/sqlc/internal/plugin" ) func TestPutOutColumns_ForZeroColumns(t *testing.T) { diff --git a/internal/codegen/golang/sqlite_type.go b/internal/codegen/golang/sqlite_type.go index 8a22aaa262..fde7e0f684 100644 --- a/internal/codegen/golang/sqlite_type.go +++ b/internal/codegen/golang/sqlite_type.go @@ -4,10 +4,10 @@ import ( "log" "strings" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/codegen/sdk" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/codegen/sdk" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/plugin" ) func sqliteType(req *plugin.GenerateRequest, options *opts.Options, col *plugin.Column) string { diff --git a/internal/codegen/golang/struct.go b/internal/codegen/golang/struct.go index ed9311800e..bf053612b4 100644 --- a/internal/codegen/golang/struct.go +++ b/internal/codegen/golang/struct.go @@ -5,8 +5,8 @@ import ( "unicode" "unicode/utf8" - "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/codegen/golang/opts" + "github.com/coder/sqlc/internal/plugin" ) type Struct struct { diff --git a/internal/codegen/json/gen.go b/internal/codegen/json/gen.go index ad797efd92..92f705b16d 100644 --- a/internal/codegen/json/gen.go +++ b/internal/codegen/json/gen.go @@ -8,7 +8,7 @@ import ( "google.golang.org/protobuf/encoding/protojson" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/plugin" ) func parseOptions(req *plugin.GenerateRequest) (*opts, error) { diff --git a/internal/codegen/sdk/sdk.go b/internal/codegen/sdk/sdk.go index 53e3fc6a9f..64f5b0710d 100644 --- a/internal/codegen/sdk/sdk.go +++ b/internal/codegen/sdk/sdk.go @@ -1,8 +1,8 @@ package sdk import ( - "github.com/sqlc-dev/sqlc/internal/pattern" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/pattern" + "github.com/coder/sqlc/internal/plugin" ) func DataType(n *plugin.Identifier) string { diff --git a/internal/compiler/analyze.go b/internal/compiler/analyze.go index 38d66fce19..74854fe4e5 100644 --- a/internal/compiler/analyze.go +++ b/internal/compiler/analyze.go @@ -3,13 +3,13 @@ package compiler import ( "sort" - analyzer "github.com/sqlc-dev/sqlc/internal/analysis" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/source" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/named" - "github.com/sqlc-dev/sqlc/internal/sql/rewrite" - "github.com/sqlc-dev/sqlc/internal/sql/validate" + analyzer "github.com/coder/sqlc/internal/analysis" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/source" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/named" + "github.com/coder/sqlc/internal/sql/rewrite" + "github.com/coder/sqlc/internal/sql/validate" ) type analysis struct { diff --git a/internal/compiler/compat.go b/internal/compiler/compat.go index 097d889cfb..162e6cb462 100644 --- a/internal/compiler/compat.go +++ b/internal/compiler/compat.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" ) // This is mainly copy-pasted from internal/postgresql/parse.go diff --git a/internal/compiler/compile.go b/internal/compiler/compile.go index 84fbb20a3c..d0534ef4c9 100644 --- a/internal/compiler/compile.go +++ b/internal/compiler/compile.go @@ -8,14 +8,14 @@ import ( "path/filepath" "strings" - "github.com/sqlc-dev/sqlc/internal/migrations" - "github.com/sqlc-dev/sqlc/internal/multierr" - "github.com/sqlc-dev/sqlc/internal/opts" - "github.com/sqlc-dev/sqlc/internal/rpc" - "github.com/sqlc-dev/sqlc/internal/source" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/migrations" + "github.com/coder/sqlc/internal/multierr" + "github.com/coder/sqlc/internal/opts" + "github.com/coder/sqlc/internal/rpc" + "github.com/coder/sqlc/internal/source" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/sqlpath" ) // TODO: Rename this interface Engine diff --git a/internal/compiler/engine.go b/internal/compiler/engine.go index f742bfd999..42733c8db9 100644 --- a/internal/compiler/engine.go +++ b/internal/compiler/engine.go @@ -4,15 +4,15 @@ import ( "context" "fmt" - "github.com/sqlc-dev/sqlc/internal/analyzer" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/dbmanager" - "github.com/sqlc-dev/sqlc/internal/engine/dolphin" - "github.com/sqlc-dev/sqlc/internal/engine/postgresql" - pganalyze "github.com/sqlc-dev/sqlc/internal/engine/postgresql/analyzer" - "github.com/sqlc-dev/sqlc/internal/engine/sqlite" - "github.com/sqlc-dev/sqlc/internal/opts" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/analyzer" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/dbmanager" + "github.com/coder/sqlc/internal/engine/dolphin" + "github.com/coder/sqlc/internal/engine/postgresql" + pganalyze "github.com/coder/sqlc/internal/engine/postgresql/analyzer" + "github.com/coder/sqlc/internal/engine/sqlite" + "github.com/coder/sqlc/internal/opts" + "github.com/coder/sqlc/internal/sql/catalog" ) type Compiler struct { diff --git a/internal/compiler/expand.go b/internal/compiler/expand.go index c60b7618b2..03591ef35f 100644 --- a/internal/compiler/expand.go +++ b/internal/compiler/expand.go @@ -5,10 +5,10 @@ import ( "regexp" "strings" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/source" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/source" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" ) func (c *Compiler) expand(qc *QueryCatalog, raw *ast.RawStmt) ([]source.Edit, error) { diff --git a/internal/compiler/find_params.go b/internal/compiler/find_params.go index 8199addd33..f845ba6224 100644 --- a/internal/compiler/find_params.go +++ b/internal/compiler/find_params.go @@ -3,8 +3,8 @@ package compiler import ( "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" ) func findParameters(root ast.Node) ([]paramRef, []error) { diff --git a/internal/compiler/output_columns.go b/internal/compiler/output_columns.go index b0a15e6ac4..b8fb1b443a 100644 --- a/internal/compiler/output_columns.go +++ b/internal/compiler/output_columns.go @@ -4,11 +4,11 @@ import ( "errors" "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" - "github.com/sqlc-dev/sqlc/internal/sql/lang" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/lang" + "github.com/coder/sqlc/internal/sql/sqlerr" ) // OutputColumns determines which columns a statement will output diff --git a/internal/compiler/parse.go b/internal/compiler/parse.go index 681d291122..49d76d3c95 100644 --- a/internal/compiler/parse.go +++ b/internal/compiler/parse.go @@ -6,13 +6,13 @@ import ( "fmt" "strings" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/metadata" - "github.com/sqlc-dev/sqlc/internal/opts" - "github.com/sqlc-dev/sqlc/internal/source" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" - "github.com/sqlc-dev/sqlc/internal/sql/validate" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/metadata" + "github.com/coder/sqlc/internal/opts" + "github.com/coder/sqlc/internal/source" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/validate" ) func (c *Compiler) parseQuery(stmt ast.Node, src string, o opts.Parser) (*Query, error) { diff --git a/internal/compiler/query.go b/internal/compiler/query.go index b3cf9d6154..30d1a445cd 100644 --- a/internal/compiler/query.go +++ b/internal/compiler/query.go @@ -1,9 +1,9 @@ package compiler import ( - "github.com/sqlc-dev/sqlc/internal/metadata" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/metadata" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) type Function struct { diff --git a/internal/compiler/query_catalog.go b/internal/compiler/query_catalog.go index 80b59d876c..6a28e75345 100644 --- a/internal/compiler/query_catalog.go +++ b/internal/compiler/query_catalog.go @@ -3,9 +3,9 @@ package compiler import ( "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" - "github.com/sqlc-dev/sqlc/internal/sql/rewrite" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/rewrite" ) type QueryCatalog struct { diff --git a/internal/compiler/resolve.go b/internal/compiler/resolve.go index b1fbb1990e..3225d11d77 100644 --- a/internal/compiler/resolve.go +++ b/internal/compiler/resolve.go @@ -5,12 +5,12 @@ import ( "log/slog" "strconv" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" - "github.com/sqlc-dev/sqlc/internal/sql/named" - "github.com/sqlc-dev/sqlc/internal/sql/rewrite" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/named" + "github.com/coder/sqlc/internal/sql/rewrite" + "github.com/coder/sqlc/internal/sql/sqlerr" ) func dataType(n *ast.TypeName) string { diff --git a/internal/compiler/result.go b/internal/compiler/result.go index 3647da630f..297c7f27c6 100644 --- a/internal/compiler/result.go +++ b/internal/compiler/result.go @@ -1,7 +1,7 @@ package compiler import ( - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/catalog" ) type Result struct { diff --git a/internal/compiler/to_column.go b/internal/compiler/to_column.go index 3267107c8b..3a8b03dcf0 100644 --- a/internal/compiler/to_column.go +++ b/internal/compiler/to_column.go @@ -3,8 +3,8 @@ package compiler import ( "strings" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" ) func arrayDims(n *ast.TypeName) int { diff --git a/internal/config/config.go b/internal/config/config.go index 0ff805fccd..1e455d6fa7 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -8,7 +8,7 @@ import ( "gopkg.in/yaml.v3" - golang "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" + golang "github.com/coder/sqlc/internal/codegen/golang/opts" ) type versionSetting struct { diff --git a/internal/config/v_one.go b/internal/config/v_one.go index 8efa9f42fc..37eab183b9 100644 --- a/internal/config/v_one.go +++ b/internal/config/v_one.go @@ -7,7 +7,7 @@ import ( yaml "gopkg.in/yaml.v3" - golang "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" + golang "github.com/coder/sqlc/internal/codegen/golang/opts" ) type V1GenerateSettings struct { diff --git a/internal/dbmanager/client.go b/internal/dbmanager/client.go index 18aec947cb..ceb28cec99 100644 --- a/internal/dbmanager/client.go +++ b/internal/dbmanager/client.go @@ -11,9 +11,9 @@ import ( "github.com/jackc/pgx/v5" "golang.org/x/sync/singleflight" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/pgx/poolcache" - "github.com/sqlc-dev/sqlc/internal/shfmt" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/pgx/poolcache" + "github.com/coder/sqlc/internal/shfmt" ) type CreateDatabaseRequest struct { diff --git a/internal/debug/dump.go b/internal/debug/dump.go index 6921ecb67f..b3c056becf 100644 --- a/internal/debug/dump.go +++ b/internal/debug/dump.go @@ -7,7 +7,7 @@ import ( "github.com/davecgh/go-spew/spew" - "github.com/sqlc-dev/sqlc/internal/opts" + "github.com/coder/sqlc/internal/opts" ) var Active bool diff --git a/internal/endtoend/ddl_test.go b/internal/endtoend/ddl_test.go index bed9333743..9f0164c319 100644 --- a/internal/endtoend/ddl_test.go +++ b/internal/endtoend/ddl_test.go @@ -6,8 +6,8 @@ import ( "path/filepath" "testing" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/sqltest/local" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/sqltest/local" ) func TestValidSchema(t *testing.T) { diff --git a/internal/endtoend/endtoend_test.go b/internal/endtoend/endtoend_test.go index 311eba9825..66f5089a1f 100644 --- a/internal/endtoend/endtoend_test.go +++ b/internal/endtoend/endtoend_test.go @@ -14,10 +14,10 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/sqlc-dev/sqlc/internal/cmd" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/opts" - "github.com/sqlc-dev/sqlc/internal/sqltest/docker" + "github.com/coder/sqlc/internal/cmd" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/opts" + "github.com/coder/sqlc/internal/sqltest/docker" ) func lineEndings() cmp.Option { diff --git a/internal/endtoend/fmt_test.go b/internal/endtoend/fmt_test.go index 04e753e5b7..8201362f7f 100644 --- a/internal/endtoend/fmt_test.go +++ b/internal/endtoend/fmt_test.go @@ -8,9 +8,9 @@ import ( "strings" "testing" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/engine/postgresql" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/engine/postgresql" + "github.com/coder/sqlc/internal/sql/ast" ) func TestFormat(t *testing.T) { diff --git a/internal/endtoend/testdata/overrides/mysql/go/models.go b/internal/endtoend/testdata/overrides/mysql/go/models.go index e6ba74a5a0..3d26047cf8 100644 --- a/internal/endtoend/testdata/overrides/mysql/go/models.go +++ b/internal/endtoend/testdata/overrides/mysql/go/models.go @@ -5,7 +5,7 @@ package override import ( - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Foo struct { diff --git a/internal/endtoend/testdata/overrides/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/overrides/postgresql/pgx/v4/go/models.go index 051e7672e0..e8e85f328a 100644 --- a/internal/endtoend/testdata/overrides/postgresql/pgx/v4/go/models.go +++ b/internal/endtoend/testdata/overrides/postgresql/pgx/v4/go/models.go @@ -6,7 +6,7 @@ package override import ( "github.com/lib/pq" - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Foo struct { diff --git a/internal/endtoend/testdata/overrides/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/overrides/postgresql/pgx/v5/go/models.go index 051e7672e0..e8e85f328a 100644 --- a/internal/endtoend/testdata/overrides/postgresql/pgx/v5/go/models.go +++ b/internal/endtoend/testdata/overrides/postgresql/pgx/v5/go/models.go @@ -6,7 +6,7 @@ package override import ( "github.com/lib/pq" - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Foo struct { diff --git a/internal/endtoend/testdata/overrides/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/overrides/postgresql/stdlib/go/models.go index 051e7672e0..e8e85f328a 100644 --- a/internal/endtoend/testdata/overrides/postgresql/stdlib/go/models.go +++ b/internal/endtoend/testdata/overrides/postgresql/stdlib/go/models.go @@ -6,7 +6,7 @@ package override import ( "github.com/lib/pq" - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Foo struct { diff --git a/internal/endtoend/testdata/overrides/sqlite/go/models.go b/internal/endtoend/testdata/overrides/sqlite/go/models.go index e6ba74a5a0..3d26047cf8 100644 --- a/internal/endtoend/testdata/overrides/sqlite/go/models.go +++ b/internal/endtoend/testdata/overrides/sqlite/go/models.go @@ -5,7 +5,7 @@ package override import ( - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Foo struct { diff --git a/internal/endtoend/testdata/overrides_config/v2/yaml/global/db/models.go b/internal/endtoend/testdata/overrides_config/v2/yaml/global/db/models.go index 48fa1bcf32..bc260bf12a 100644 --- a/internal/endtoend/testdata/overrides_config/v2/yaml/global/db/models.go +++ b/internal/endtoend/testdata/overrides_config/v2/yaml/global/db/models.go @@ -5,7 +5,7 @@ package db import ( - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Override struct { diff --git a/internal/endtoend/testdata/overrides_config/v2/yaml/global_and_queryset/db/models.go b/internal/endtoend/testdata/overrides_config/v2/yaml/global_and_queryset/db/models.go index 48fa1bcf32..bc260bf12a 100644 --- a/internal/endtoend/testdata/overrides_config/v2/yaml/global_and_queryset/db/models.go +++ b/internal/endtoend/testdata/overrides_config/v2/yaml/global_and_queryset/db/models.go @@ -5,7 +5,7 @@ package db import ( - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Override struct { diff --git a/internal/endtoend/testdata/overrides_config/v2/yaml/queryset/db/models.go b/internal/endtoend/testdata/overrides_config/v2/yaml/queryset/db/models.go index 48fa1bcf32..bc260bf12a 100644 --- a/internal/endtoend/testdata/overrides_config/v2/yaml/queryset/db/models.go +++ b/internal/endtoend/testdata/overrides_config/v2/yaml/queryset/db/models.go @@ -5,7 +5,7 @@ package db import ( - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Override struct { diff --git a/internal/endtoend/testdata/overrides_go_types/mysql/go/models.go b/internal/endtoend/testdata/overrides_go_types/mysql/go/models.go index ba5ce329c7..f2954477f8 100644 --- a/internal/endtoend/testdata/overrides_go_types/mysql/go/models.go +++ b/internal/endtoend/testdata/overrides_go_types/mysql/go/models.go @@ -5,7 +5,7 @@ package override import ( - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Bar struct { diff --git a/internal/endtoend/testdata/overrides_go_types/mysql/go/query.sql.go b/internal/endtoend/testdata/overrides_go_types/mysql/go/query.sql.go index b34ccf09bd..a12a677c88 100644 --- a/internal/endtoend/testdata/overrides_go_types/mysql/go/query.sql.go +++ b/internal/endtoend/testdata/overrides_go_types/mysql/go/query.sql.go @@ -9,7 +9,7 @@ import ( "context" "strings" - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) const testIN = `-- name: TestIN :many diff --git a/internal/endtoend/testdata/overrides_go_types/sqlite/go/models.go b/internal/endtoend/testdata/overrides_go_types/sqlite/go/models.go index ba5ce329c7..f2954477f8 100644 --- a/internal/endtoend/testdata/overrides_go_types/sqlite/go/models.go +++ b/internal/endtoend/testdata/overrides_go_types/sqlite/go/models.go @@ -5,7 +5,7 @@ package override import ( - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Bar struct { diff --git a/internal/endtoend/testdata/single_param_conflict/postgresql/pgx/v4/go/query.sql.go b/internal/endtoend/testdata/single_param_conflict/postgresql/pgx/v4/go/query.sql.go index 1912659d8b..239b4f11d5 100644 --- a/internal/endtoend/testdata/single_param_conflict/postgresql/pgx/v4/go/query.sql.go +++ b/internal/endtoend/testdata/single_param_conflict/postgresql/pgx/v4/go/query.sql.go @@ -59,7 +59,7 @@ WHERE id = $1 RETURNING id ` -// https://github.com/sqlc-dev/sqlc/issues/1235 +// https://github.com/coder/sqlc/issues/1235 func (q *Queries) SetDefaultName(ctx context.Context, id int64) (int64, error) { row := q.db.QueryRow(ctx, setDefaultName, id) err := row.Scan(&id) diff --git a/internal/endtoend/testdata/single_param_conflict/postgresql/pgx/v5/go/query.sql.go b/internal/endtoend/testdata/single_param_conflict/postgresql/pgx/v5/go/query.sql.go index daa903d8c2..6fef063760 100644 --- a/internal/endtoend/testdata/single_param_conflict/postgresql/pgx/v5/go/query.sql.go +++ b/internal/endtoend/testdata/single_param_conflict/postgresql/pgx/v5/go/query.sql.go @@ -59,7 +59,7 @@ WHERE id = $1 RETURNING id ` -// https://github.com/sqlc-dev/sqlc/issues/1235 +// https://github.com/coder/sqlc/issues/1235 func (q *Queries) SetDefaultName(ctx context.Context, id int64) (int64, error) { row := q.db.QueryRow(ctx, setDefaultName, id) err := row.Scan(&id) diff --git a/internal/endtoend/testdata/single_param_conflict/postgresql/stdlib/go/query.sql.go b/internal/endtoend/testdata/single_param_conflict/postgresql/stdlib/go/query.sql.go index 0b99078536..5c5ac70608 100644 --- a/internal/endtoend/testdata/single_param_conflict/postgresql/stdlib/go/query.sql.go +++ b/internal/endtoend/testdata/single_param_conflict/postgresql/stdlib/go/query.sql.go @@ -59,7 +59,7 @@ WHERE id = $1 RETURNING id ` -// https://github.com/sqlc-dev/sqlc/issues/1235 +// https://github.com/coder/sqlc/issues/1235 func (q *Queries) SetDefaultName(ctx context.Context, id int64) (int64, error) { row := q.db.QueryRowContext(ctx, setDefaultName, id) err := row.Scan(&id) diff --git a/internal/endtoend/testdata/sqlc_slice/mysql/go/models.go b/internal/endtoend/testdata/sqlc_slice/mysql/go/models.go index 77be1976cf..b98951e22e 100644 --- a/internal/endtoend/testdata/sqlc_slice/mysql/go/models.go +++ b/internal/endtoend/testdata/sqlc_slice/mysql/go/models.go @@ -7,7 +7,7 @@ package querytest import ( "database/sql" - "github.com/sqlc-dev/sqlc-testdata/mysql" + "github.com/coder/sqlc-testdata/mysql" ) type Foo struct { diff --git a/internal/endtoend/testdata/sqlc_slice/mysql/go/query.sql.go b/internal/endtoend/testdata/sqlc_slice/mysql/go/query.sql.go index 72d5617d0a..d52d589dde 100644 --- a/internal/endtoend/testdata/sqlc_slice/mysql/go/query.sql.go +++ b/internal/endtoend/testdata/sqlc_slice/mysql/go/query.sql.go @@ -10,7 +10,7 @@ import ( "database/sql" "strings" - "github.com/sqlc-dev/sqlc-testdata/mysql" + "github.com/coder/sqlc-testdata/mysql" ) const funcNullable = `-- name: FuncNullable :many diff --git a/internal/endtoend/testdata/yaml_overrides/go/models.go b/internal/endtoend/testdata/yaml_overrides/go/models.go index 051e7672e0..e8e85f328a 100644 --- a/internal/endtoend/testdata/yaml_overrides/go/models.go +++ b/internal/endtoend/testdata/yaml_overrides/go/models.go @@ -6,7 +6,7 @@ package override import ( "github.com/lib/pq" - "github.com/sqlc-dev/sqlc-testdata/pkg" + "github.com/coder/sqlc-testdata/pkg" ) type Foo struct { diff --git a/internal/endtoend/vet_test.go b/internal/endtoend/vet_test.go index 011c032c2e..1c9320133d 100644 --- a/internal/endtoend/vet_test.go +++ b/internal/endtoend/vet_test.go @@ -11,9 +11,9 @@ import ( "strings" "testing" - "github.com/sqlc-dev/sqlc/internal/cmd" - "github.com/sqlc-dev/sqlc/internal/sqltest" - "github.com/sqlc-dev/sqlc/internal/sqltest/local" + "github.com/coder/sqlc/internal/cmd" + "github.com/coder/sqlc/internal/sqltest" + "github.com/coder/sqlc/internal/sqltest/local" ) func findSchema(t *testing.T, path string) (string, bool) { diff --git a/internal/engine/dolphin/catalog.go b/internal/engine/dolphin/catalog.go index e7872f7c95..3b48f6db74 100644 --- a/internal/engine/dolphin/catalog.go +++ b/internal/engine/dolphin/catalog.go @@ -1,7 +1,7 @@ package dolphin import ( - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/catalog" ) func NewCatalog() *catalog.Catalog { diff --git a/internal/engine/dolphin/convert.go b/internal/engine/dolphin/convert.go index 33b89ae8f4..3f9b2f3008 100644 --- a/internal/engine/dolphin/convert.go +++ b/internal/engine/dolphin/convert.go @@ -10,8 +10,8 @@ import ( driver "github.com/pingcap/tidb/pkg/parser/test_driver" "github.com/pingcap/tidb/pkg/parser/types" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/sql/ast" ) type cc struct { diff --git a/internal/engine/dolphin/parse.go b/internal/engine/dolphin/parse.go index 537f7ad64f..7cbefa950b 100644 --- a/internal/engine/dolphin/parse.go +++ b/internal/engine/dolphin/parse.go @@ -10,9 +10,9 @@ import ( "github.com/pingcap/tidb/pkg/parser" _ "github.com/pingcap/tidb/pkg/parser/test_driver" - "github.com/sqlc-dev/sqlc/internal/source" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/source" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) func NewParser() *Parser { diff --git a/internal/engine/dolphin/stdlib.go b/internal/engine/dolphin/stdlib.go index 41469ca49d..e24a832f38 100644 --- a/internal/engine/dolphin/stdlib.go +++ b/internal/engine/dolphin/stdlib.go @@ -1,8 +1,8 @@ package dolphin import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) func defaultSchema(name string) *catalog.Schema { diff --git a/internal/engine/dolphin/utils.go b/internal/engine/dolphin/utils.go index e920489e6a..ae46a7c480 100644 --- a/internal/engine/dolphin/utils.go +++ b/internal/engine/dolphin/utils.go @@ -4,7 +4,7 @@ import ( pcast "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/parser/mysql" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/ast" ) func parseTableName(n *pcast.TableName) *ast.TableName { diff --git a/internal/engine/postgresql/analyzer/analyze.go b/internal/engine/postgresql/analyzer/analyze.go index 5a08fa98ec..52d817cfa1 100644 --- a/internal/engine/postgresql/analyzer/analyze.go +++ b/internal/engine/postgresql/analyzer/analyze.go @@ -11,14 +11,14 @@ import ( "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" - core "github.com/sqlc-dev/sqlc/internal/analysis" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/dbmanager" - "github.com/sqlc-dev/sqlc/internal/opts" - "github.com/sqlc-dev/sqlc/internal/shfmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/named" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + core "github.com/coder/sqlc/internal/analysis" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/dbmanager" + "github.com/coder/sqlc/internal/opts" + "github.com/coder/sqlc/internal/shfmt" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/named" + "github.com/coder/sqlc/internal/sql/sqlerr" ) type Analyzer struct { diff --git a/internal/engine/postgresql/catalog.go b/internal/engine/postgresql/catalog.go index 3c262122a2..33153d4f6c 100644 --- a/internal/engine/postgresql/catalog.go +++ b/internal/engine/postgresql/catalog.go @@ -1,6 +1,6 @@ package postgresql -import "github.com/sqlc-dev/sqlc/internal/sql/catalog" +import "github.com/coder/sqlc/internal/sql/catalog" // toPointer converts an int to a pointer without a temporary // variable at the call-site, and is used by the generated schemas diff --git a/internal/engine/postgresql/catalog_test.go b/internal/engine/postgresql/catalog_test.go index 875ea7e458..45d4331ea6 100644 --- a/internal/engine/postgresql/catalog_test.go +++ b/internal/engine/postgresql/catalog_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/sqlerr" "github.com/google/go-cmp/cmp" ) diff --git a/internal/engine/postgresql/contrib/adminpack.go b/internal/engine/postgresql/contrib/adminpack.go index 1e47e12434..fbdd2f09af 100644 --- a/internal/engine/postgresql/contrib/adminpack.go +++ b/internal/engine/postgresql/contrib/adminpack.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsAdminpack = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/amcheck.go b/internal/engine/postgresql/contrib/amcheck.go index 156cb43eb7..db7115985d 100644 --- a/internal/engine/postgresql/contrib/amcheck.go +++ b/internal/engine/postgresql/contrib/amcheck.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsAmcheck = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/btree_gin.go b/internal/engine/postgresql/contrib/btree_gin.go index 54a5000a26..cd035e67b7 100644 --- a/internal/engine/postgresql/contrib/btree_gin.go +++ b/internal/engine/postgresql/contrib/btree_gin.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsBtreeGin = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/btree_gist.go b/internal/engine/postgresql/contrib/btree_gist.go index b5b3ddaf6f..b42df6f5b4 100644 --- a/internal/engine/postgresql/contrib/btree_gist.go +++ b/internal/engine/postgresql/contrib/btree_gist.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsBtreeGist = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/citext.go b/internal/engine/postgresql/contrib/citext.go index d5749cacdf..70aaf4e6de 100644 --- a/internal/engine/postgresql/contrib/citext.go +++ b/internal/engine/postgresql/contrib/citext.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsCitext = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/cube.go b/internal/engine/postgresql/contrib/cube.go index cb883db658..8237a8f03c 100644 --- a/internal/engine/postgresql/contrib/cube.go +++ b/internal/engine/postgresql/contrib/cube.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsCube = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/dblink.go b/internal/engine/postgresql/contrib/dblink.go index b24cd16a52..188126ec8d 100644 --- a/internal/engine/postgresql/contrib/dblink.go +++ b/internal/engine/postgresql/contrib/dblink.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsDblink = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/earthdistance.go b/internal/engine/postgresql/contrib/earthdistance.go index 5c0bfa7cd5..19a8715745 100644 --- a/internal/engine/postgresql/contrib/earthdistance.go +++ b/internal/engine/postgresql/contrib/earthdistance.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsEarthdistance = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/file_fdw.go b/internal/engine/postgresql/contrib/file_fdw.go index 36d6db31d5..1333ebdcbe 100644 --- a/internal/engine/postgresql/contrib/file_fdw.go +++ b/internal/engine/postgresql/contrib/file_fdw.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsFileFdw = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/fuzzystrmatch.go b/internal/engine/postgresql/contrib/fuzzystrmatch.go index fcf0ddea83..eae1fe61f1 100644 --- a/internal/engine/postgresql/contrib/fuzzystrmatch.go +++ b/internal/engine/postgresql/contrib/fuzzystrmatch.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsFuzzystrmatch = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/hstore.go b/internal/engine/postgresql/contrib/hstore.go index 77403f1913..87f052d74a 100644 --- a/internal/engine/postgresql/contrib/hstore.go +++ b/internal/engine/postgresql/contrib/hstore.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsHstore = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/intagg.go b/internal/engine/postgresql/contrib/intagg.go index a1c1b83c33..70efb1cd09 100644 --- a/internal/engine/postgresql/contrib/intagg.go +++ b/internal/engine/postgresql/contrib/intagg.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsIntagg = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/intarray.go b/internal/engine/postgresql/contrib/intarray.go index 24005a8bc1..403533a852 100644 --- a/internal/engine/postgresql/contrib/intarray.go +++ b/internal/engine/postgresql/contrib/intarray.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsIntarray = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/isn.go b/internal/engine/postgresql/contrib/isn.go index 98220a434a..9770ac53e1 100644 --- a/internal/engine/postgresql/contrib/isn.go +++ b/internal/engine/postgresql/contrib/isn.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsIsn = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/lo.go b/internal/engine/postgresql/contrib/lo.go index 1e6869c1d6..2e50199885 100644 --- a/internal/engine/postgresql/contrib/lo.go +++ b/internal/engine/postgresql/contrib/lo.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsLo = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/ltree.go b/internal/engine/postgresql/contrib/ltree.go index d149aee058..e5849a0577 100644 --- a/internal/engine/postgresql/contrib/ltree.go +++ b/internal/engine/postgresql/contrib/ltree.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsLtree = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pageinspect.go b/internal/engine/postgresql/contrib/pageinspect.go index 5a733eec2e..4331ebe7b8 100644 --- a/internal/engine/postgresql/contrib/pageinspect.go +++ b/internal/engine/postgresql/contrib/pageinspect.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPageinspect = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pg_buffercache.go b/internal/engine/postgresql/contrib/pg_buffercache.go index 8f10545121..bf0f98f4f7 100644 --- a/internal/engine/postgresql/contrib/pg_buffercache.go +++ b/internal/engine/postgresql/contrib/pg_buffercache.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPgBuffercache = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pg_freespacemap.go b/internal/engine/postgresql/contrib/pg_freespacemap.go index 02aed8630e..2b4e27d535 100644 --- a/internal/engine/postgresql/contrib/pg_freespacemap.go +++ b/internal/engine/postgresql/contrib/pg_freespacemap.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPgFreespacemap = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pg_prewarm.go b/internal/engine/postgresql/contrib/pg_prewarm.go index 4fbd8910aa..c2e0ba11a0 100644 --- a/internal/engine/postgresql/contrib/pg_prewarm.go +++ b/internal/engine/postgresql/contrib/pg_prewarm.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPgPrewarm = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pg_stat_statements.go b/internal/engine/postgresql/contrib/pg_stat_statements.go index a0c5fc73d7..eb096b7ef9 100644 --- a/internal/engine/postgresql/contrib/pg_stat_statements.go +++ b/internal/engine/postgresql/contrib/pg_stat_statements.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPgStatStatements = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pg_trgm.go b/internal/engine/postgresql/contrib/pg_trgm.go index 92639009eb..308eb3b5ef 100644 --- a/internal/engine/postgresql/contrib/pg_trgm.go +++ b/internal/engine/postgresql/contrib/pg_trgm.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPgTrgm = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pg_visibility.go b/internal/engine/postgresql/contrib/pg_visibility.go index f546ad0f12..7d0e8f0ba9 100644 --- a/internal/engine/postgresql/contrib/pg_visibility.go +++ b/internal/engine/postgresql/contrib/pg_visibility.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPgVisibility = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pgcrypto.go b/internal/engine/postgresql/contrib/pgcrypto.go index ef1fc073bc..cf23dde33f 100644 --- a/internal/engine/postgresql/contrib/pgcrypto.go +++ b/internal/engine/postgresql/contrib/pgcrypto.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPgcrypto = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pgrowlocks.go b/internal/engine/postgresql/contrib/pgrowlocks.go index 1bd8af0163..5fbfb8bc95 100644 --- a/internal/engine/postgresql/contrib/pgrowlocks.go +++ b/internal/engine/postgresql/contrib/pgrowlocks.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPgrowlocks = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/pgstattuple.go b/internal/engine/postgresql/contrib/pgstattuple.go index 4ac5b18345..3780c80f0f 100644 --- a/internal/engine/postgresql/contrib/pgstattuple.go +++ b/internal/engine/postgresql/contrib/pgstattuple.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPgstattuple = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/postgres_fdw.go b/internal/engine/postgresql/contrib/postgres_fdw.go index cf8d9746ff..04a7913382 100644 --- a/internal/engine/postgresql/contrib/postgres_fdw.go +++ b/internal/engine/postgresql/contrib/postgres_fdw.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsPostgresFdw = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/seg.go b/internal/engine/postgresql/contrib/seg.go index 20de65a1ef..4e8c315277 100644 --- a/internal/engine/postgresql/contrib/seg.go +++ b/internal/engine/postgresql/contrib/seg.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsSeg = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/sslinfo.go b/internal/engine/postgresql/contrib/sslinfo.go index b7327d0a3f..93c0bfae32 100644 --- a/internal/engine/postgresql/contrib/sslinfo.go +++ b/internal/engine/postgresql/contrib/sslinfo.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsSslinfo = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/tablefunc.go b/internal/engine/postgresql/contrib/tablefunc.go index 611a36ed19..e943bf7021 100644 --- a/internal/engine/postgresql/contrib/tablefunc.go +++ b/internal/engine/postgresql/contrib/tablefunc.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsTablefunc = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/tcn.go b/internal/engine/postgresql/contrib/tcn.go index 6a227216aa..3d20882677 100644 --- a/internal/engine/postgresql/contrib/tcn.go +++ b/internal/engine/postgresql/contrib/tcn.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsTcn = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/unaccent.go b/internal/engine/postgresql/contrib/unaccent.go index 07e2e1ae9a..dfa9952e4f 100644 --- a/internal/engine/postgresql/contrib/unaccent.go +++ b/internal/engine/postgresql/contrib/unaccent.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsUnaccent = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/uuid_ossp.go b/internal/engine/postgresql/contrib/uuid_ossp.go index 1703e323a2..ac9d4027f5 100644 --- a/internal/engine/postgresql/contrib/uuid_ossp.go +++ b/internal/engine/postgresql/contrib/uuid_ossp.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsUuidOssp = []*catalog.Function{ diff --git a/internal/engine/postgresql/contrib/xml2.go b/internal/engine/postgresql/contrib/xml2.go index 6fac3f04b9..9fb5fdcb82 100644 --- a/internal/engine/postgresql/contrib/xml2.go +++ b/internal/engine/postgresql/contrib/xml2.go @@ -3,8 +3,8 @@ package contrib import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsXml2 = []*catalog.Function{ diff --git a/internal/engine/postgresql/convert.go b/internal/engine/postgresql/convert.go index f56a572c16..4c9a7d9fd1 100644 --- a/internal/engine/postgresql/convert.go +++ b/internal/engine/postgresql/convert.go @@ -5,7 +5,7 @@ import ( pg "github.com/pganalyze/pg_query_go/v6" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/ast" ) func convertFuncParamMode(m pg.FunctionParameterMode) (ast.FuncParamMode, error) { diff --git a/internal/engine/postgresql/extension.go b/internal/engine/postgresql/extension.go index c2bfed5c5c..0df7110bfa 100644 --- a/internal/engine/postgresql/extension.go +++ b/internal/engine/postgresql/extension.go @@ -3,8 +3,8 @@ package postgresql import ( - "github.com/sqlc-dev/sqlc/internal/engine/postgresql/contrib" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/engine/postgresql/contrib" + "github.com/coder/sqlc/internal/sql/catalog" ) func loadExtension(name string) *catalog.Schema { diff --git a/internal/engine/postgresql/information_schema.go b/internal/engine/postgresql/information_schema.go index ac76d47905..c5dd1dea56 100644 --- a/internal/engine/postgresql/information_schema.go +++ b/internal/engine/postgresql/information_schema.go @@ -3,8 +3,8 @@ package postgresql import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsgenInformationSchema = []*catalog.Function{} diff --git a/internal/engine/postgresql/parse.go b/internal/engine/postgresql/parse.go index 40af125962..fec20804dc 100644 --- a/internal/engine/postgresql/parse.go +++ b/internal/engine/postgresql/parse.go @@ -8,10 +8,10 @@ import ( nodes "github.com/pganalyze/pg_query_go/v6" - "github.com/sqlc-dev/sqlc/internal/engine/postgresql/parser" - "github.com/sqlc-dev/sqlc/internal/source" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/engine/postgresql/parser" + "github.com/coder/sqlc/internal/source" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) func stringSlice(list *nodes.List) []string { diff --git a/internal/engine/postgresql/pg_catalog.go b/internal/engine/postgresql/pg_catalog.go index 9000b592f4..0162d733ee 100644 --- a/internal/engine/postgresql/pg_catalog.go +++ b/internal/engine/postgresql/pg_catalog.go @@ -3,8 +3,8 @@ package postgresql import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcsgenPGCatalog = []*catalog.Function{ diff --git a/internal/engine/postgresql/pg_temp.go b/internal/engine/postgresql/pg_temp.go index bedf105910..2d72648016 100644 --- a/internal/engine/postgresql/pg_temp.go +++ b/internal/engine/postgresql/pg_temp.go @@ -1,7 +1,7 @@ package postgresql import ( - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/catalog" ) func pgTemp() *catalog.Schema { diff --git a/internal/engine/postgresql/rewrite_test.go b/internal/engine/postgresql/rewrite_test.go index 4a2460cd2f..1f8df00cab 100644 --- a/internal/engine/postgresql/rewrite_test.go +++ b/internal/engine/postgresql/rewrite_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" "github.com/google/go-cmp/cmp" ) diff --git a/internal/engine/sqlite/catalog.go b/internal/engine/sqlite/catalog.go index d7d27489a9..d773643de5 100644 --- a/internal/engine/sqlite/catalog.go +++ b/internal/engine/sqlite/catalog.go @@ -1,6 +1,6 @@ package sqlite -import "github.com/sqlc-dev/sqlc/internal/sql/catalog" +import "github.com/coder/sqlc/internal/sql/catalog" func NewCatalog() *catalog.Catalog { def := "main" diff --git a/internal/engine/sqlite/catalog_test.go b/internal/engine/sqlite/catalog_test.go index bf6dcd8316..e55e6332e9 100644 --- a/internal/engine/sqlite/catalog_test.go +++ b/internal/engine/sqlite/catalog_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" diff --git a/internal/engine/sqlite/convert.go b/internal/engine/sqlite/convert.go index 658a9d7f33..9bf2f483ea 100644 --- a/internal/engine/sqlite/convert.go +++ b/internal/engine/sqlite/convert.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/antlr4-go/antlr/v4" - "github.com/sqlc-dev/sqlc/internal/debug" - "github.com/sqlc-dev/sqlc/internal/engine/sqlite/parser" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/debug" + "github.com/coder/sqlc/internal/engine/sqlite/parser" + "github.com/coder/sqlc/internal/sql/ast" ) type cc struct { diff --git a/internal/engine/sqlite/parse.go b/internal/engine/sqlite/parse.go index 13425b156e..5b263f9a37 100644 --- a/internal/engine/sqlite/parse.go +++ b/internal/engine/sqlite/parse.go @@ -6,9 +6,9 @@ import ( "io" "github.com/antlr4-go/antlr/v4" - "github.com/sqlc-dev/sqlc/internal/engine/sqlite/parser" - "github.com/sqlc-dev/sqlc/internal/source" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/engine/sqlite/parser" + "github.com/coder/sqlc/internal/source" + "github.com/coder/sqlc/internal/sql/ast" ) type errorListener struct { diff --git a/internal/engine/sqlite/stdlib.go b/internal/engine/sqlite/stdlib.go index 89b7af2e92..29065acebe 100644 --- a/internal/engine/sqlite/stdlib.go +++ b/internal/engine/sqlite/stdlib.go @@ -1,8 +1,8 @@ package sqlite import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) // sqlite functions from: diff --git a/internal/engine/sqlite/utils.go b/internal/engine/sqlite/utils.go index 874d53ab41..2aa627e179 100644 --- a/internal/engine/sqlite/utils.go +++ b/internal/engine/sqlite/utils.go @@ -1,8 +1,8 @@ package sqlite import ( - "github.com/sqlc-dev/sqlc/internal/engine/sqlite/parser" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/engine/sqlite/parser" + "github.com/coder/sqlc/internal/sql/ast" ) type tableNamer interface { diff --git a/internal/ext/handler.go b/internal/ext/handler.go index 2542dc1a82..a065b2b66d 100644 --- a/internal/ext/handler.go +++ b/internal/ext/handler.go @@ -8,7 +8,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/plugin" ) type Handler interface { diff --git a/internal/ext/process/gen.go b/internal/ext/process/gen.go index b5720dbc33..73a94eb8c1 100644 --- a/internal/ext/process/gen.go +++ b/internal/ext/process/gen.go @@ -15,7 +15,7 @@ import ( "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" - "github.com/sqlc-dev/sqlc/internal/info" + "github.com/coder/sqlc/internal/info" ) type Runner struct { diff --git a/internal/ext/wasm/wasm.go b/internal/ext/wasm/wasm.go index 58384a9c95..08972f65f2 100644 --- a/internal/ext/wasm/wasm.go +++ b/internal/ext/wasm/wasm.go @@ -24,9 +24,9 @@ import ( "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" - "github.com/sqlc-dev/sqlc/internal/cache" - "github.com/sqlc-dev/sqlc/internal/info" - "github.com/sqlc-dev/sqlc/internal/plugin" + "github.com/coder/sqlc/internal/cache" + "github.com/coder/sqlc/internal/info" + "github.com/coder/sqlc/internal/plugin" ) var flight singleflight.Group @@ -167,7 +167,7 @@ func (r *Runner) loadAndCompileWASM(ctx context.Context, cache string, expected // removePGCatalog removes the pg_catalog schema from the request. There is a // mysterious (reason unknown) bug with wasm plugins when a large amount of // tables (like there are in the catalog) are sent. -// @see https://github.com/sqlc-dev/sqlc/pull/1748 +// @see https://github.com/coder/sqlc/pull/1748 func removePGCatalog(req *plugin.GenerateRequest) { if req.Catalog == nil || req.Catalog.Schemas == nil { return diff --git a/internal/inflection/singular.go b/internal/inflection/singular.go index 64e042a6ab..02d084dbb6 100644 --- a/internal/inflection/singular.go +++ b/internal/inflection/singular.go @@ -20,21 +20,21 @@ func Singular(s SingularParams) string { // Manual fix for incorrect handling of "campus" // - // https://github.com/sqlc-dev/sqlc/issues/430 + // https://github.com/coder/sqlc/issues/430 // https://github.com/jinzhu/inflection/issues/13 if strings.ToLower(s.Name) == "campus" { return s.Name } // Manual fix for incorrect handling of "meta" // - // https://github.com/sqlc-dev/sqlc/issues/1217 + // https://github.com/coder/sqlc/issues/1217 // https://github.com/jinzhu/inflection/issues/21 if strings.ToLower(s.Name) == "meta" { return s.Name } // Manual fix for incorrect handling of "calories" // - // https://github.com/sqlc-dev/sqlc/issues/2017 + // https://github.com/coder/sqlc/issues/2017 // https://github.com/jinzhu/inflection/issues/23 if strings.ToLower(s.Name) == "calories" { return "calorie" diff --git a/internal/metadata/meta.go b/internal/metadata/meta.go index 8f63624d2c..1963306082 100644 --- a/internal/metadata/meta.go +++ b/internal/metadata/meta.go @@ -3,11 +3,11 @@ package metadata import ( "bufio" "fmt" - "github.com/sqlc-dev/sqlc/internal/constants" + "github.com/coder/sqlc/internal/constants" "strings" "unicode" - "github.com/sqlc-dev/sqlc/internal/source" + "github.com/coder/sqlc/internal/source" ) type CommentSyntax source.CommentSyntax diff --git a/internal/multierr/error.go b/internal/multierr/error.go index 433a24bf80..163ca98059 100644 --- a/internal/multierr/error.go +++ b/internal/multierr/error.go @@ -3,8 +3,8 @@ package multierr import ( "fmt" - "github.com/sqlc-dev/sqlc/internal/source" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/source" + "github.com/coder/sqlc/internal/sql/sqlerr" ) type FileError struct { diff --git a/internal/quickdb/rpc.go b/internal/quickdb/rpc.go index 9d9649d3dc..982d294044 100644 --- a/internal/quickdb/rpc.go +++ b/internal/quickdb/rpc.go @@ -7,9 +7,9 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" - "github.com/sqlc-dev/sqlc/internal/config" - pb "github.com/sqlc-dev/sqlc/internal/quickdb/v1" - "github.com/sqlc-dev/sqlc/internal/rpc" + "github.com/coder/sqlc/internal/config" + pb "github.com/coder/sqlc/internal/quickdb/v1" + "github.com/coder/sqlc/internal/rpc" ) const defaultHostname = "grpc.sqlc.dev" diff --git a/internal/remote/rpc.go b/internal/remote/rpc.go index 4adc9f8681..ee3bdf864a 100644 --- a/internal/remote/rpc.go +++ b/internal/remote/rpc.go @@ -7,8 +7,8 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/rpc" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/rpc" ) const defaultHostname = "remote.sqlc.dev" diff --git a/internal/sql/ast/print.go b/internal/sql/ast/print.go index 867a53a177..12d32b6a63 100644 --- a/internal/sql/ast/print.go +++ b/internal/sql/ast/print.go @@ -3,7 +3,7 @@ package ast import ( "strings" - "github.com/sqlc-dev/sqlc/internal/debug" + "github.com/coder/sqlc/internal/debug" ) type formatter interface { diff --git a/internal/sql/astutils/join.go b/internal/sql/astutils/join.go index 5535d72f7c..2f9d0c2671 100644 --- a/internal/sql/astutils/join.go +++ b/internal/sql/astutils/join.go @@ -3,7 +3,7 @@ package astutils import ( "strings" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/ast" ) func Join(list *ast.List, sep string) string { diff --git a/internal/sql/astutils/rewrite.go b/internal/sql/astutils/rewrite.go index 93c5be3cfb..ff80e2a31e 100644 --- a/internal/sql/astutils/rewrite.go +++ b/internal/sql/astutils/rewrite.go @@ -8,7 +8,7 @@ import ( "fmt" "reflect" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/ast" ) // An ApplyFunc is invoked by Apply for each node n, even if n is nil, diff --git a/internal/sql/astutils/search.go b/internal/sql/astutils/search.go index d61ee1345a..272ad39295 100644 --- a/internal/sql/astutils/search.go +++ b/internal/sql/astutils/search.go @@ -1,6 +1,6 @@ package astutils -import "github.com/sqlc-dev/sqlc/internal/sql/ast" +import "github.com/coder/sqlc/internal/sql/ast" type nodeSearch struct { list *ast.List diff --git a/internal/sql/astutils/walk.go b/internal/sql/astutils/walk.go index 0943379f03..608d08901b 100644 --- a/internal/sql/astutils/walk.go +++ b/internal/sql/astutils/walk.go @@ -3,7 +3,7 @@ package astutils import ( "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/ast" ) type Visitor interface { diff --git a/internal/sql/catalog/catalog.go b/internal/sql/catalog/catalog.go index 278ea8797d..e85de56489 100644 --- a/internal/sql/catalog/catalog.go +++ b/internal/sql/catalog/catalog.go @@ -1,7 +1,7 @@ package catalog import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/ast" ) // Catalog describes a database instance consisting of metadata in which database objects are defined diff --git a/internal/sql/catalog/comment_on.go b/internal/sql/catalog/comment_on.go index 49c7144913..6769aada05 100644 --- a/internal/sql/catalog/comment_on.go +++ b/internal/sql/catalog/comment_on.go @@ -1,8 +1,8 @@ package catalog import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) func (c *Catalog) commentOnColumn(stmt *ast.CommentOnColumnStmt) error { diff --git a/internal/sql/catalog/extension.go b/internal/sql/catalog/extension.go index fdb717f2d2..f74274bddc 100644 --- a/internal/sql/catalog/extension.go +++ b/internal/sql/catalog/extension.go @@ -1,7 +1,7 @@ package catalog import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/ast" ) func (c *Catalog) createExtension(stmt *ast.CreateExtensionStmt) error { diff --git a/internal/sql/catalog/func.go b/internal/sql/catalog/func.go index e170777311..888c7283ef 100644 --- a/internal/sql/catalog/func.go +++ b/internal/sql/catalog/func.go @@ -3,8 +3,8 @@ package catalog import ( "errors" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) // Function describes a database function diff --git a/internal/sql/catalog/public.go b/internal/sql/catalog/public.go index 19fd50722f..c1cdfae400 100644 --- a/internal/sql/catalog/public.go +++ b/internal/sql/catalog/public.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) func (c *Catalog) schemasToSearch(ns string) []string { diff --git a/internal/sql/catalog/schema.go b/internal/sql/catalog/schema.go index 72a32a6ff8..55a5544de2 100644 --- a/internal/sql/catalog/schema.go +++ b/internal/sql/catalog/schema.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) // Schema describes how the data in a relational database may relate to other tables or other data models diff --git a/internal/sql/catalog/table.go b/internal/sql/catalog/table.go index dc30acfa1e..f098cff9cc 100644 --- a/internal/sql/catalog/table.go +++ b/internal/sql/catalog/table.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) // Table describes a relational database table diff --git a/internal/sql/catalog/types.go b/internal/sql/catalog/types.go index 464472bcf2..b636c2cae6 100644 --- a/internal/sql/catalog/types.go +++ b/internal/sql/catalog/types.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) type Type interface { diff --git a/internal/sql/catalog/view.go b/internal/sql/catalog/view.go index d5222c4d03..44896d8a62 100644 --- a/internal/sql/catalog/view.go +++ b/internal/sql/catalog/view.go @@ -1,8 +1,8 @@ package catalog import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) func (c *Catalog) createView(stmt *ast.ViewStmt, colGen columnGenerator) error { diff --git a/internal/sql/info/info.go b/internal/sql/info/info.go index 48484ef38c..7f1b45da32 100644 --- a/internal/sql/info/info.go +++ b/internal/sql/info/info.go @@ -1,7 +1,7 @@ package info import ( - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/catalog" ) // Provide a read-only view into the catalog diff --git a/internal/sql/named/is.go b/internal/sql/named/is.go index d53c1d9905..cb10997728 100644 --- a/internal/sql/named/is.go +++ b/internal/sql/named/is.go @@ -1,8 +1,8 @@ package named import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" ) // IsParamFunc fulfills the astutils.Search diff --git a/internal/sql/rewrite/embeds.go b/internal/sql/rewrite/embeds.go index 596c03be89..37214f3c17 100644 --- a/internal/sql/rewrite/embeds.go +++ b/internal/sql/rewrite/embeds.go @@ -3,8 +3,8 @@ package rewrite import ( "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" ) // Embed is an instance of `sqlc.embed(param)` diff --git a/internal/sql/rewrite/parameters.go b/internal/sql/rewrite/parameters.go index d1ea1a22cc..63f182da67 100644 --- a/internal/sql/rewrite/parameters.go +++ b/internal/sql/rewrite/parameters.go @@ -4,11 +4,11 @@ import ( "fmt" "strings" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/source" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" - "github.com/sqlc-dev/sqlc/internal/sql/named" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/source" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/named" ) // Given an AST node, return the string representation of names diff --git a/internal/sql/sqlpath/read.go b/internal/sql/sqlpath/read.go index 278ebf3a05..da86b77162 100644 --- a/internal/sql/sqlpath/read.go +++ b/internal/sql/sqlpath/read.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/sqlc-dev/sqlc/internal/migrations" + "github.com/coder/sqlc/internal/migrations" ) // Return a list of SQL files in the listed paths. diff --git a/internal/sql/validate/cmd.go b/internal/sql/validate/cmd.go index 66e849de6c..6ed7170fa0 100644 --- a/internal/sql/validate/cmd.go +++ b/internal/sql/validate/cmd.go @@ -4,10 +4,10 @@ import ( "errors" "fmt" - "github.com/sqlc-dev/sqlc/internal/metadata" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" - "github.com/sqlc-dev/sqlc/internal/sql/named" + "github.com/coder/sqlc/internal/metadata" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/named" ) func validateCopyfrom(n ast.Node) error { diff --git a/internal/sql/validate/func_call.go b/internal/sql/validate/func_call.go index dad621eb12..f89682a3ec 100644 --- a/internal/sql/validate/func_call.go +++ b/internal/sql/validate/func_call.go @@ -3,11 +3,11 @@ package validate import ( "errors" - "github.com/sqlc-dev/sqlc/internal/config" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/config" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/sqlerr" ) type funcCallVisitor struct { diff --git a/internal/sql/validate/in.go b/internal/sql/validate/in.go index 56bcee125d..421bf98389 100644 --- a/internal/sql/validate/in.go +++ b/internal/sql/validate/in.go @@ -3,10 +3,10 @@ package validate import ( "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/sqlerr" ) type inVisitor struct { diff --git a/internal/sql/validate/insert_stmt.go b/internal/sql/validate/insert_stmt.go index dd8041ea23..0d24130eb4 100644 --- a/internal/sql/validate/insert_stmt.go +++ b/internal/sql/validate/insert_stmt.go @@ -1,8 +1,8 @@ package validate import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/sqlerr" ) func InsertStmt(stmt *ast.InsertStmt) error { diff --git a/internal/sql/validate/param_ref.go b/internal/sql/validate/param_ref.go index ab9413f40f..1f1103f733 100644 --- a/internal/sql/validate/param_ref.go +++ b/internal/sql/validate/param_ref.go @@ -4,9 +4,9 @@ import ( "errors" "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/sqlerr" ) func ParamRef(n ast.Node) (map[int]bool, bool, error) { diff --git a/internal/sql/validate/param_style.go b/internal/sql/validate/param_style.go index 1182051d20..216aff59fb 100644 --- a/internal/sql/validate/param_style.go +++ b/internal/sql/validate/param_style.go @@ -3,9 +3,9 @@ package validate import ( "fmt" - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/astutils" - "github.com/sqlc-dev/sqlc/internal/sql/sqlerr" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/astutils" + "github.com/coder/sqlc/internal/sql/sqlerr" ) type sqlcFuncVisitor struct { diff --git a/internal/sqltest/local/mysql.go b/internal/sqltest/local/mysql.go index dedd3dfd78..5b85f34194 100644 --- a/internal/sqltest/local/mysql.go +++ b/internal/sqltest/local/mysql.go @@ -11,9 +11,9 @@ import ( "github.com/go-sql-driver/mysql" - migrate "github.com/sqlc-dev/sqlc/internal/migrations" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" - "github.com/sqlc-dev/sqlc/internal/sqltest/docker" + migrate "github.com/coder/sqlc/internal/migrations" + "github.com/coder/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/sqltest/docker" ) var mysqlSync sync.Once diff --git a/internal/sqltest/local/postgres.go b/internal/sqltest/local/postgres.go index feda4cf7ac..1d2502cfc4 100644 --- a/internal/sqltest/local/postgres.go +++ b/internal/sqltest/local/postgres.go @@ -12,10 +12,10 @@ import ( "github.com/jackc/pgx/v5" "golang.org/x/sync/singleflight" - migrate "github.com/sqlc-dev/sqlc/internal/migrations" - "github.com/sqlc-dev/sqlc/internal/pgx/poolcache" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" - "github.com/sqlc-dev/sqlc/internal/sqltest/docker" + migrate "github.com/coder/sqlc/internal/migrations" + "github.com/coder/sqlc/internal/pgx/poolcache" + "github.com/coder/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/sqltest/docker" ) var flight singleflight.Group diff --git a/internal/sqltest/mysql.go b/internal/sqltest/mysql.go index bddfe0042c..5e2aea4c9a 100644 --- a/internal/sqltest/mysql.go +++ b/internal/sqltest/mysql.go @@ -9,7 +9,7 @@ import ( _ "github.com/go-sql-driver/mysql" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/sql/sqlpath" ) func MySQL(t *testing.T, migrations []string) (*sql.DB, func()) { diff --git a/internal/sqltest/pgx.go b/internal/sqltest/pgx.go index 73e01701bd..394c7ef698 100644 --- a/internal/sqltest/pgx.go +++ b/internal/sqltest/pgx.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/sql/sqlpath" "github.com/jackc/pgx/v4" ) diff --git a/internal/sqltest/postgres.go b/internal/sqltest/postgres.go index edf6272d41..e0d3a334bf 100644 --- a/internal/sqltest/postgres.go +++ b/internal/sqltest/postgres.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/sql/sqlpath" _ "github.com/lib/pq" ) diff --git a/internal/sqltest/sqlite.go b/internal/sqltest/sqlite.go index 0e5161967d..bef24c93f8 100644 --- a/internal/sqltest/sqlite.go +++ b/internal/sqltest/sqlite.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/sqlc-dev/sqlc/internal/sql/sqlpath" + "github.com/coder/sqlc/internal/sql/sqlpath" ) func SQLite(t *testing.T, migrations []string) (*sql.DB, func()) { diff --git a/internal/tools/sqlc-pg-gen/main.go b/internal/tools/sqlc-pg-gen/main.go index d70dcb9595..ec3330ccbd 100644 --- a/internal/tools/sqlc-pg-gen/main.go +++ b/internal/tools/sqlc-pg-gen/main.go @@ -48,8 +48,8 @@ const catalogTmpl = ` package {{.Pkg}} import ( - "github.com/sqlc-dev/sqlc/internal/sql/ast" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/sql/ast" + "github.com/coder/sqlc/internal/sql/catalog" ) var funcs{{.GenFnName}} = []*catalog.Function { @@ -119,8 +119,8 @@ const loaderFuncTmpl = ` package postgresql import ( - "github.com/sqlc-dev/sqlc/internal/engine/postgresql/contrib" - "github.com/sqlc-dev/sqlc/internal/sql/catalog" + "github.com/coder/sqlc/internal/engine/postgresql/contrib" + "github.com/coder/sqlc/internal/sql/catalog" ) func loadExtension(name string) *catalog.Schema { diff --git a/internal/tools/sqlc-pg-gen/proc.go b/internal/tools/sqlc-pg-gen/proc.go index 07629ed6ea..3d0e31765b 100644 --- a/internal/tools/sqlc-pg-gen/proc.go +++ b/internal/tools/sqlc-pg-gen/proc.go @@ -61,7 +61,7 @@ func (p *Proc) Args() []Arg { }) } - // Some manual changes until https://github.com/sqlc-dev/sqlc/pull/1748 + // Some manual changes until https://github.com/coder/sqlc/pull/1748 // can be completely implmented if p.Name == "mode" { return nil diff --git a/internal/tracer/trace.go b/internal/tracer/trace.go index 8252f49b38..210e25b0b2 100644 --- a/internal/tracer/trace.go +++ b/internal/tracer/trace.go @@ -6,7 +6,7 @@ import ( "os" "runtime/trace" - "github.com/sqlc-dev/sqlc/internal/debug" + "github.com/coder/sqlc/internal/debug" ) // Start starts Go's runtime tracing facility. diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index c83b699c6e..4f8120218a 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -8,7 +8,7 @@ // import ( // "os" // -// sqlc "github.com/sqlc-dev/sqlc/pkg/cli" +// sqlc "github.com/coder/sqlc/pkg/cli" // ) // // func main() { @@ -19,7 +19,7 @@ package cli import ( "os" - "github.com/sqlc-dev/sqlc/internal/cmd" + "github.com/coder/sqlc/internal/cmd" ) // Run the sqlc CLI. It takes an array of command-line arguments diff --git a/placeholder.go b/placeholder.go index c53616c9fb..9b921997a0 100644 --- a/placeholder.go +++ b/placeholder.go @@ -1,6 +1,6 @@ package sqlc // This is a dummy file that allows SQLC to be "installed" as a module and locked using -// go.mod and then run using "go run github.com/sqlc-dev/sqlc" +// go.mod and then run using "go run github.com/coder/sqlc" type Placeholder struct{} diff --git a/scripts/build/main.go b/scripts/build/main.go index 6841c52e74..70e8f68d87 100755 --- a/scripts/build/main.go +++ b/scripts/build/main.go @@ -28,7 +28,7 @@ func main() { fmt.Printf("::set-output name=version::%s\n", version) - x := "-X github.com/sqlc-dev/sqlc/internal/cmd.version=" + version + x := "-X github.com/coder/sqlc/internal/cmd.version=" + version args := []string{ "build", "-ldflags", x, diff --git a/scripts/mirror-go-plugin/main.go b/scripts/mirror-go-plugin/main.go index 48277dc373..aae3020a81 100644 --- a/scripts/mirror-go-plugin/main.go +++ b/scripts/mirror-go-plugin/main.go @@ -35,32 +35,32 @@ func main() { os.MkdirAll(filepath.Dir(newpath), 0755) contents = bytes.ReplaceAll(contents, - []byte(`"github.com/sqlc-dev/sqlc/internal/codegen/golang/opts"`), - []byte(`"github.com/sqlc-dev/sqlc-gen-go/internal/opts"`)) + []byte(`"github.com/coder/sqlc/internal/codegen/golang/opts"`), + []byte(`"github.com/coder/sqlc-gen-go/internal/opts"`)) contents = bytes.ReplaceAll(contents, - []byte(`"github.com/sqlc-dev/sqlc/internal/plugin"`), + []byte(`"github.com/coder/sqlc/internal/plugin"`), []byte(`"github.com/sqlc-dev/plugin-sdk-go/plugin"`)) contents = bytes.ReplaceAll(contents, - []byte(`"github.com/sqlc-dev/sqlc/internal/codegen/sdk"`), + []byte(`"github.com/coder/sqlc/internal/codegen/sdk"`), []byte(`"github.com/sqlc-dev/plugin-sdk-go/sdk"`)) contents = bytes.ReplaceAll(contents, - []byte(`"github.com/sqlc-dev/sqlc/internal/metadata"`), + []byte(`"github.com/coder/sqlc/internal/metadata"`), []byte(`"github.com/sqlc-dev/plugin-sdk-go/metadata"`)) contents = bytes.ReplaceAll(contents, - []byte(`"github.com/sqlc-dev/sqlc/internal/pattern"`), + []byte(`"github.com/coder/sqlc/internal/pattern"`), []byte(`"github.com/sqlc-dev/plugin-sdk-go/pattern"`)) contents = bytes.ReplaceAll(contents, - []byte(`"github.com/sqlc-dev/sqlc/internal/debug"`), - []byte(`"github.com/sqlc-dev/sqlc-gen-go/internal/debug"`)) + []byte(`"github.com/coder/sqlc/internal/debug"`), + []byte(`"github.com/coder/sqlc-gen-go/internal/debug"`)) contents = bytes.ReplaceAll(contents, - []byte(`"github.com/sqlc-dev/sqlc/internal/inflection"`), - []byte(`"github.com/sqlc-dev/sqlc-gen-go/internal/inflection"`)) + []byte(`"github.com/coder/sqlc/internal/inflection"`), + []byte(`"github.com/coder/sqlc-gen-go/internal/inflection"`)) if err := os.WriteFile(newpath, contents, 0644); err != nil { return err diff --git a/scripts/release.go b/scripts/release.go index a8651a6ee7..ee7a135962 100755 --- a/scripts/release.go +++ b/scripts/release.go @@ -32,7 +32,7 @@ func main() { } if *docker { - x := "-extldflags \"-static\" -X github.com/sqlc-dev/sqlc/internal/cmd.version=" + version + x := "-extldflags \"-static\" -X github.com/coder/sqlc/internal/cmd.version=" + version args := []string{ "build", "-a", From fb627c9c93f089ff1888f6799ca348986b2818e0 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 13 Nov 2026 19:22:58 +0200 Subject: [PATCH 2/2] Track CTE scope to resolve ambiguous column references (#1) A subquery inside a CTE made sqlc resolve column references in that CTE, and in CTEs selecting from it, against the subquery's tables too. Valid queries then failed to generate with false positives such as `column reference "owner_id" is ambiguous` or `column "w_owner_id" does not exist`. Track the CTE each reference belongs to when resolving columns and parameters. Parameters inside a CTE, or compared against a CTE column, now get the referenced type instead of a nullable fallback: cte_left_join and cte_update generate string, bool and int64 where they generated pgtype.Text, pgtype.Bool and pgtype.Int8. The fix previously lived only on the mafredri/fix-ambiguous-column.import branch that coder/coder pinned. It never reached main, so coder/coder lost it when it moved its pin to main's merge of upstream v1.31.1 (#6). The upstream PR, sqlc-dev/sqlc#4159, is still open. --- internal/compiler/analyze.go | 4 +- internal/compiler/find_params.go | 16 +- internal/compiler/output_columns.go | 6 +- internal/compiler/parse.go | 40 +++-- internal/compiler/resolve.go | 82 +++++---- .../postgresql/stdlib/go/db.go | 31 ++++ .../postgresql/stdlib/go/models.go | 22 +++ .../postgresql/stdlib/go/query.sql.go | 155 ++++++++++++++++++ .../postgresql/stdlib/query.sql | 38 +++++ .../postgresql/stdlib/schema.sql | 12 ++ .../postgresql/stdlib/sqlc.yaml | 9 + .../postgresql/pgx/go/query.sql.go | 6 +- .../cte_update/postgresql/pgx/go/query.sql.go | 6 +- 13 files changed, 370 insertions(+), 57 deletions(-) create mode 100644 internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/db.go create mode 100644 internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/models.go create mode 100644 internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/query.sql.go create mode 100644 internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/query.sql create mode 100644 internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/schema.sql create mode 100644 internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/sqlc.yaml diff --git a/internal/compiler/analyze.go b/internal/compiler/analyze.go index ad2d671d18..e092584bfa 100644 --- a/internal/compiler/analyze.go +++ b/internal/compiler/analyze.go @@ -161,7 +161,7 @@ func (c *Compiler) _analyzeQuery(raw *ast.RawStmt, query string, failfast bool) if err := check(validate.In(c.catalog, raw)); err != nil { return nil, err } - rvs := rangeVars(raw.Stmt) + scopedRVs := rangeVarsWithScope(raw.Stmt) refs, errs := findParameters(raw.Stmt) if len(errs) > 0 { if failfast { @@ -181,7 +181,7 @@ func (c *Compiler) _analyzeQuery(raw *ast.RawStmt, query string, failfast bool) return nil, err } - params, err := c.resolveCatalogRefs(qc, rvs, refs, namedParams, embeds) + params, err := c.resolveCatalogRefs(qc, scopedRVs, refs, namedParams, embeds) if err := check(err); err != nil { return nil, err } diff --git a/internal/compiler/find_params.go b/internal/compiler/find_params.go index f845ba6224..acc0a334e9 100644 --- a/internal/compiler/find_params.go +++ b/internal/compiler/find_params.go @@ -24,6 +24,8 @@ type paramRef struct { rv *ast.RangeVar ref *ast.ParamRef name string // Named parameter support + + cteName *string // Current CTE name, nil if not inside a CTE. } type paramSearch struct { @@ -36,6 +38,8 @@ type paramSearch struct { // XXX: Gross state hack for limit limitCount ast.Node limitOffset ast.Node + + cteName *string // Current CTE name, nil if not inside a CTE. } type limitCount struct { @@ -55,6 +59,10 @@ func (l *limitOffset) Pos() int { func (p paramSearch) Visit(node ast.Node) astutils.Visitor { switch n := node.(type) { + case *ast.CommonTableExpr: + p.cteName = n.Ctename + return p + case *ast.A_Expr: p.parent = node @@ -87,7 +95,7 @@ func (p paramSearch) Visit(node ast.Node) astutils.Visitor { *p.errs = append(*p.errs, fmt.Errorf("INSERT has more expressions than target columns")) return p } - *p.refs = append(*p.refs, paramRef{parent: n.Cols.Items[i], ref: ref, rv: n.Relation}) + *p.refs = append(*p.refs, paramRef{parent: n.Cols.Items[i], ref: ref, rv: n.Relation, cteName: p.cteName}) p.seen[ref.Location] = struct{}{} } for _, item := range s.ValuesLists.Items { @@ -104,7 +112,7 @@ func (p paramSearch) Visit(node ast.Node) astutils.Visitor { *p.errs = append(*p.errs, fmt.Errorf("INSERT has more expressions than target columns")) return p } - *p.refs = append(*p.refs, paramRef{parent: n.Cols.Items[i], ref: ref, rv: n.Relation}) + *p.refs = append(*p.refs, paramRef{parent: n.Cols.Items[i], ref: ref, rv: n.Relation, cteName: p.cteName}) p.seen[ref.Location] = struct{}{} } } @@ -125,7 +133,7 @@ func (p paramSearch) Visit(node ast.Node) astutils.Visitor { if !ok { continue } - *p.refs = append(*p.refs, paramRef{parent: target, ref: ref, rv: rv}) + *p.refs = append(*p.refs, paramRef{parent: target, ref: ref, rv: rv, cteName: p.cteName}) } p.seen[ref.Location] = struct{}{} } @@ -186,7 +194,7 @@ func (p paramSearch) Visit(node ast.Node) astutils.Visitor { } if set { - *p.refs = append(*p.refs, paramRef{parent: parent, ref: n, rv: p.rangeVar}) + *p.refs = append(*p.refs, paramRef{parent: parent, ref: n, rv: p.rangeVar, cteName: p.cteName}) p.seen[n.Location] = struct{}{} } return nil diff --git a/internal/compiler/output_columns.go b/internal/compiler/output_columns.go index 7617a74ed3..e2600239df 100644 --- a/internal/compiler/output_columns.go +++ b/internal/compiler/output_columns.go @@ -22,6 +22,10 @@ func (c *Compiler) OutputColumns(stmt ast.Node) ([]*catalog.Column, error) { return nil, err } + return convertColumnsToCatalog(cols), nil +} + +func convertColumnsToCatalog(cols []*Column) []*catalog.Column { catCols := make([]*catalog.Column, 0, len(cols)) for _, col := range cols { catCols = append(catCols, &catalog.Column{ @@ -35,7 +39,7 @@ func (c *Compiler) OutputColumns(stmt ast.Node) ([]*catalog.Column, error) { Length: col.Length, }) } - return catCols, nil + return catCols } func hasStarRef(cf *ast.ColumnRef) bool { diff --git a/internal/compiler/parse.go b/internal/compiler/parse.go index 4bdcf66781..539430306d 100644 --- a/internal/compiler/parse.go +++ b/internal/compiler/parse.go @@ -181,16 +181,36 @@ func (c *Compiler) parseQuery(stmt ast.Node, src string, o opts.Parser) (*Query, }, nil } -func rangeVars(root ast.Node) []*ast.RangeVar { - var vars []*ast.RangeVar - find := astutils.VisitorFunc(func(node ast.Node) { - switch n := node.(type) { - case *ast.RangeVar: - vars = append(vars, n) - } - }) - astutils.Walk(find, root) - return vars +// scopedRangeVar associates a RangeVar with a scope. +type scopedRangeVar struct { + rv *ast.RangeVar + + cteName *string // Current CTE name, nil if not inside a CTE. +} + +// rangeVarsWithScope collects all RangeVars with their scope. +func rangeVarsWithScope(root ast.Node) []scopedRangeVar { + var rvs []scopedRangeVar + visitor := &rvSearch{rvs: &rvs, cteName: nil} + astutils.Walk(visitor, root) + return rvs +} + +// rvSearch finds all RangeVars and tracks their scope. +type rvSearch struct { + rvs *[]scopedRangeVar + + cteName *string // Current CTE name, nil if not inside a CTE. +} + +func (v *rvSearch) Visit(node ast.Node) astutils.Visitor { + switch n := node.(type) { + case *ast.CommonTableExpr: + return &rvSearch{rvs: v.rvs, cteName: n.Ctename} + case *ast.RangeVar: + *v.rvs = append(*v.rvs, scopedRangeVar{rv: n, cteName: v.cteName}) + } + return v } func uniqueParamRefs(in []paramRef, dollar bool) []paramRef { diff --git a/internal/compiler/resolve.go b/internal/compiler/resolve.go index bffe1871a7..3c3febd832 100644 --- a/internal/compiler/resolve.go +++ b/internal/compiler/resolve.go @@ -21,36 +21,50 @@ func dataType(n *ast.TypeName) string { } } -func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, rvs []*ast.RangeVar, args []paramRef, params *named.ParamSet, embeds rewrite.EmbedSet) ([]Parameter, error) { +func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, scopedRVs []scopedRangeVar, args []paramRef, params *named.ParamSet, embeds rewrite.EmbedSet) ([]Parameter, error) { c := comp.catalog + scopeMap := make(map[*string][]*ast.TableName) + outerAliasMap := map[string]*ast.TableName{} aliasMap := map[string]*ast.TableName{} + tableNameMap := map[string]*ast.TableName{} // TODO: Deprecate defaultTable var defaultTable *ast.TableName var tables []*ast.TableName - typeMap := map[string]map[string]map[string]*catalog.Column{} - indexTable := func(table catalog.Table) error { - tables = append(tables, table.Rel) + + indexTableWithColumns := func(rel *ast.TableName, cols []*catalog.Column) error { + tables = append(tables, rel) + tableNameMap[rel.Name] = rel if defaultTable == nil { - defaultTable = table.Rel + defaultTable = rel } - schema := table.Rel.Schema + schema := rel.Schema if schema == "" { schema = c.DefaultSchema } if _, exists := typeMap[schema]; !exists { typeMap[schema] = map[string]map[string]*catalog.Column{} } - typeMap[schema][table.Rel.Name] = map[string]*catalog.Column{} - for _, c := range table.Columns { - cc := c - typeMap[schema][table.Rel.Name][c.Name] = cc + typeMap[schema][rel.Name] = map[string]*catalog.Column{} + for _, c := range cols { + typeMap[schema][rel.Name][c.Name] = c } return nil } - for _, rv := range rvs { + indexTable := func(table catalog.Table) error { + return indexTableWithColumns(table.Rel, table.Columns) + } + + indexCTE := func(cte *Table) error { + catalogCols := convertColumnsToCatalog(cte.Columns) + return indexTableWithColumns(cte.Rel, catalogCols) + } + + for _, srv := range scopedRVs { + rv := srv.rv + scope := srv.cteName if rv.Relname == nil { continue } @@ -58,6 +72,12 @@ func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, rvs []*ast.RangeVar, if err != nil { return nil, err } + + scopeMap[scope] = append(scopeMap[scope], fqn) + if scope == nil && rv.Alias != nil { + outerAliasMap[*rv.Alias.Aliasname] = fqn + } + if _, found := aliasMap[fqn.Name]; found { continue } @@ -67,9 +87,16 @@ func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, rvs []*ast.RangeVar, continue } // If the table name doesn't exist, first check if it's a CTE - if _, qcerr := qc.GetTable(fqn); qcerr != nil { + cte, qcerr := qc.GetTable(fqn) + if qcerr != nil { return nil, err } + if err := indexCTE(cte); err != nil { + return nil, err + } + if rv.Alias != nil { + aliasMap[*rv.Alias.Aliasname] = fqn + } continue } err = indexTable(table) @@ -89,7 +116,7 @@ func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, rvs []*ast.RangeVar, continue } - if alias, ok := aliasMap[embed.Table.Name]; ok { + if alias, ok := outerAliasMap[embed.Table.Name]; ok { embed.Table = alias continue } @@ -195,24 +222,17 @@ func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, rvs []*ast.RangeVar, panic("too many field items: " + strconv.Itoa(len(items))) } - search := tables + search := scopeMap[ref.cteName] if alias != "" { if original, ok := aliasMap[alias]; ok { search = []*ast.TableName{original} + } else if tableName, ok := tableNameMap[alias]; ok { + search = []*ast.TableName{tableName} } else { - var located bool - for _, fqn := range tables { - if fqn.Name == alias { - located = true - search = []*ast.TableName{fqn} - } - } - if !located { - return nil, &sqlerr.Error{ - Code: "42703", - Message: fmt.Sprintf("table alias %q does not exist", alias), - Location: node.Location, - } + return nil, &sqlerr.Error{ + Code: "42703", + Message: fmt.Sprintf("table alias %q does not exist", alias), + Location: node.Location, } } } @@ -574,12 +594,8 @@ func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, rvs []*ast.RangeVar, if alias != "" { if original, ok := aliasMap[alias]; ok { search = []*ast.TableName{original} - } else { - for _, fqn := range tables { - if fqn.Name == alias { - search = []*ast.TableName{fqn} - } - } + } else if tableName, ok := tableNameMap[alias]; ok { + search = []*ast.TableName{tableName} } } diff --git a/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/db.go b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/db.go new file mode 100644 index 0000000000..80dd6ab1f6 --- /dev/null +++ b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/db.go @@ -0,0 +1,31 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.31.1 + +package querytest + +import ( + "context" + "database/sql" +) + +type DBTX interface { + ExecContext(context.Context, string, ...interface{}) (sql.Result, error) + PrepareContext(context.Context, string) (*sql.Stmt, error) + QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) + QueryRowContext(context.Context, string, ...interface{}) *sql.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx *sql.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/models.go new file mode 100644 index 0000000000..f77802a4d5 --- /dev/null +++ b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/models.go @@ -0,0 +1,22 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.31.1 + +package querytest + +import ( + "github.com/google/uuid" +) + +type Task struct { + ID uuid.UUID + WorkspaceID uuid.NullUUID + OwnerID uuid.UUID + Name string +} + +type Workspace struct { + ID uuid.UUID + OwnerID uuid.UUID + Name string +} diff --git a/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/query.sql.go b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/query.sql.go new file mode 100644 index 0000000000..055729328b --- /dev/null +++ b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/go/query.sql.go @@ -0,0 +1,155 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.31.1 +// source: query.sql + +package querytest + +import ( + "context" + + "github.com/google/uuid" +) + +const getWorkspacesJoinTasks = `-- name: GetWorkspacesJoinTasks :many +WITH wtask AS ( + SELECT + workspaces.id, workspaces.owner_id, workspaces.name, + tasks.id IS NOT NULL::boolean AS has_task + FROM workspaces + LEFT JOIN tasks ON tasks.workspace_id = workspaces.id +) +SELECT id, owner_id, name, has_task +FROM wtask +ORDER BY CASE WHEN owner_id = $1 THEN 0 ELSE 1 END +` + +type GetWorkspacesJoinTasksRow struct { + ID uuid.UUID + OwnerID uuid.UUID + Name string + HasTask bool +} + +func (q *Queries) GetWorkspacesJoinTasks(ctx context.Context, ownerID uuid.UUID) ([]GetWorkspacesJoinTasksRow, error) { + rows, err := q.db.QueryContext(ctx, getWorkspacesJoinTasks, ownerID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []GetWorkspacesJoinTasksRow + for rows.Next() { + var i GetWorkspacesJoinTasksRow + if err := rows.Scan( + &i.ID, + &i.OwnerID, + &i.Name, + &i.HasTask, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getWorkspacesJoinTasksRenameColumn = `-- name: GetWorkspacesJoinTasksRenameColumn :many +WITH wtask AS ( + SELECT + workspaces.owner_id AS w_owner_id, + workspaces.id, workspaces.owner_id, workspaces.name, + tasks.id IS NOT NULL::boolean AS has_task + FROM workspaces + LEFT JOIN tasks ON tasks.workspace_id = workspaces.id +) +SELECT w_owner_id, id, owner_id, name, has_task +FROM wtask +ORDER BY CASE WHEN w_owner_id = $1 THEN 0 ELSE 1 END +` + +type GetWorkspacesJoinTasksRenameColumnRow struct { + WOwnerID uuid.UUID + ID uuid.UUID + OwnerID uuid.UUID + Name string + HasTask bool +} + +func (q *Queries) GetWorkspacesJoinTasksRenameColumn(ctx context.Context, ownerID uuid.UUID) ([]GetWorkspacesJoinTasksRenameColumnRow, error) { + rows, err := q.db.QueryContext(ctx, getWorkspacesJoinTasksRenameColumn, ownerID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []GetWorkspacesJoinTasksRenameColumnRow + for rows.Next() { + var i GetWorkspacesJoinTasksRenameColumnRow + if err := rows.Scan( + &i.WOwnerID, + &i.ID, + &i.OwnerID, + &i.Name, + &i.HasTask, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getWorkspacesSubQueryTasks = `-- name: GetWorkspacesSubQueryTasks :many +WITH wfiltered AS ( + SELECT workspaces.id, workspaces.owner_id, workspaces.name + FROM workspaces + WHERE EXISTS ( + SELECT 1 + FROM tasks + WHERE tasks.workspace_id = workspaces.id + ) +) +SELECT id, owner_id, name +FROM wfiltered +ORDER BY CASE WHEN owner_id = $1 THEN 0 ELSE 1 END +` + +type GetWorkspacesSubQueryTasksRow struct { + ID uuid.UUID + OwnerID uuid.UUID + Name string +} + +func (q *Queries) GetWorkspacesSubQueryTasks(ctx context.Context, ownerID uuid.UUID) ([]GetWorkspacesSubQueryTasksRow, error) { + rows, err := q.db.QueryContext(ctx, getWorkspacesSubQueryTasks, ownerID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []GetWorkspacesSubQueryTasksRow + for rows.Next() { + var i GetWorkspacesSubQueryTasksRow + if err := rows.Scan(&i.ID, &i.OwnerID, &i.Name); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/query.sql b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/query.sql new file mode 100644 index 0000000000..cfb5c43fb5 --- /dev/null +++ b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/query.sql @@ -0,0 +1,38 @@ +-- name: GetWorkspacesJoinTasks :many +WITH wtask AS ( + SELECT + workspaces.*, + tasks.id IS NOT NULL::boolean AS has_task + FROM workspaces + LEFT JOIN tasks ON tasks.workspace_id = workspaces.id +) +SELECT * +FROM wtask +ORDER BY CASE WHEN owner_id = @owner_id THEN 0 ELSE 1 END; + +-- name: GetWorkspacesJoinTasksRenameColumn :many +WITH wtask AS ( + SELECT + workspaces.owner_id AS w_owner_id, + workspaces.*, + tasks.id IS NOT NULL::boolean AS has_task + FROM workspaces + LEFT JOIN tasks ON tasks.workspace_id = workspaces.id +) +SELECT * +FROM wtask +ORDER BY CASE WHEN w_owner_id = @owner_id THEN 0 ELSE 1 END; + +-- name: GetWorkspacesSubQueryTasks :many +WITH wfiltered AS ( + SELECT workspaces.* + FROM workspaces + WHERE EXISTS ( + SELECT 1 + FROM tasks + WHERE tasks.workspace_id = workspaces.id + ) +) +SELECT * +FROM wfiltered +ORDER BY CASE WHEN owner_id = @owner_id THEN 0 ELSE 1 END; diff --git a/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/schema.sql b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/schema.sql new file mode 100644 index 0000000000..9c9b0cc44c --- /dev/null +++ b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/schema.sql @@ -0,0 +1,12 @@ +CREATE TABLE workspaces ( + id uuid NOT NULL, + owner_id uuid NOT NULL, + name text NOT NULL +); + +CREATE TABLE tasks ( + id uuid NOT NULL, + workspace_id uuid, + owner_id uuid NOT NULL, + name text NOT NULL +); diff --git a/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/sqlc.yaml b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/sqlc.yaml new file mode 100644 index 0000000000..6f830a0c9a --- /dev/null +++ b/internal/endtoend/testdata/cte_ambiguous_column/postgresql/stdlib/sqlc.yaml @@ -0,0 +1,9 @@ +version: "2" +sql: + - schema: "./schema.sql" + queries: "./" + engine: "postgresql" + gen: + go: + package: "querytest" + out: "./go" diff --git a/internal/endtoend/testdata/cte_left_join/postgresql/pgx/go/query.sql.go b/internal/endtoend/testdata/cte_left_join/postgresql/pgx/go/query.sql.go index 64c2320add..4e0516e8f8 100644 --- a/internal/endtoend/testdata/cte_left_join/postgresql/pgx/go/query.sql.go +++ b/internal/endtoend/testdata/cte_left_join/postgresql/pgx/go/query.sql.go @@ -7,8 +7,6 @@ package querytest import ( "context" - - "github.com/jackc/pgx/v5/pgtype" ) const badQuery = `-- name: BadQuery :exec @@ -28,7 +26,7 @@ FROM WHERE c1.name = $1 ` -func (q *Queries) BadQuery(ctx context.Context, dollar_1 pgtype.Text) error { - _, err := q.db.Exec(ctx, badQuery, dollar_1) +func (q *Queries) BadQuery(ctx context.Context, name string) error { + _, err := q.db.Exec(ctx, badQuery, name) return err } diff --git a/internal/endtoend/testdata/cte_update/postgresql/pgx/go/query.sql.go b/internal/endtoend/testdata/cte_update/postgresql/pgx/go/query.sql.go index 3d729de8a8..2866c3736e 100644 --- a/internal/endtoend/testdata/cte_update/postgresql/pgx/go/query.sql.go +++ b/internal/endtoend/testdata/cte_update/postgresql/pgx/go/query.sql.go @@ -23,9 +23,9 @@ from updated_attribute ` type UpdateAttributeParams struct { - FilterValue pgtype.Bool - Value pgtype.Text - ID pgtype.Int8 + FilterValue bool + Value string + ID int64 } type UpdateAttributeRow struct {