Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Finish migration to sqlc-dev/sqlc #2548

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ proto:

remote-proto:
protoc \
--go_out=. --go_opt="Minternal/remote/gen.proto=github.com/kyleconroy/sqlc/internal/remote" --go_opt=module=github.com/kyleconroy/sqlc \
--go-grpc_out=. --go-grpc_opt="Minternal/remote/gen.proto=github.com/kyleconroy/sqlc/internal/remote" --go-grpc_opt=module=github.com/kyleconroy/sqlc \
--go_out=. --go_opt="Minternal/remote/gen.proto=github.com/sqlc-dev/sqlc/internal/remote" --go_opt=module=github.com/sqlc-dev/sqlc \
--go-grpc_out=. --go-grpc_opt="Minternal/remote/gen.proto=github.com/sqlc-dev/sqlc/internal/remote" --go-grpc_opt=module=github.com/sqlc-dev/sqlc \
internal/remote/gen.proto
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# sqlc: A SQL Compiler

![go](https://github.com/kyleconroy/sqlc/workflows/go/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/kyleconroy/sqlc)](https://goreportcard.com/report/github.com/kyleconroy/sqlc)
![go](https://github.com/sqlc-dev/sqlc/workflows/go/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/sqlc-dev/sqlc)](https://goreportcard.com/report/github.com/sqlc-dev/sqlc)

sqlc generates **type-safe code** from SQL. Here's how it works:

Expand Down
2 changes: 1 addition & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file.\n
# https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}](https://github.com/kyleconroy/sqlc/releases/tag/{{ version }})
## [{{ version | trim_start_matches(pat="v") }}](https://github.com/sqlc-dev/sqlc/releases/tag/{{ version }})
{% else %}\
## [unreleased]
{% endif %}\
Expand Down
4 changes: 2 additions & 2 deletions docs/overview/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ sudo snap install sqlc
### Go >= 1.17:

```
go install github.com/kyleconroy/sqlc/cmd/sqlc@latest
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
```

### Go < 1.17:

```
go get github.com/kyleconroy/sqlc/cmd/sqlc
go get github.com/sqlc-dev/sqlc/cmd/sqlc
```

## Docker
Expand Down
2 changes: 1 addition & 1 deletion internal/config/override.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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/kyleconroy/sqlc/issues/534
// see https://github.com/sqlc-dev/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`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/1195
-- https://github.com/sqlc-dev/sqlc/issues/1195

CREATE TABLE authors (
id BIGINT PRIMARY KEY,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/1195
-- https://github.com/sqlc-dev/sqlc/issues/1195

CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/kyleconroy/sqlc/endtoend
module github.com/sqlc-dev/sqlc/endtoend

go 1.18

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/437
-- https://github.com/sqlc-dev/sqlc/issues/437
CREATE TABLE authors (
id INT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/437
-- https://github.com/sqlc-dev/sqlc/issues/437
CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/437
-- https://github.com/sqlc-dev/sqlc/issues/437
CREATE TABLE authors (
id INT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
Expand Down
6 changes: 3 additions & 3 deletions internal/endtoend/testdata/join_left/mysql/query.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/604
-- https://github.com/sqlc-dev/sqlc/issues/604
CREATE TABLE users (
user_id INT PRIMARY KEY,
city_id INT -- nullable
Expand Down Expand Up @@ -29,7 +29,7 @@ FROM users
LEFT JOIN cities USING (city_id)
LEFT JOIN mayors USING (mayor_id);

-- https://github.com/kyleconroy/sqlc/issues/1334
-- https://github.com/sqlc-dev/sqlc/issues/1334
CREATE TABLE authors (
id INT PRIMARY KEY,
name TEXT NOT NULL,
Expand Down Expand Up @@ -78,7 +78,7 @@ FROM authors a
LEFT JOIN super_authors sa
ON a.parent_id = sa.super_id;

-- https://github.com/kyleconroy/sqlc/issues/1334
-- https://github.com/sqlc-dev/sqlc/issues/1334
CREATE TABLE users_2 (
user_id INT PRIMARY KEY,
user_nickname VARCHAR(30) UNIQUE NOT NULL,
Expand Down
6 changes: 3 additions & 3 deletions internal/endtoend/testdata/join_left/postgresql/query.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- https://github.com/kyleconroy/sqlc/issues/604
--- https://github.com/sqlc-dev/sqlc/issues/604
CREATE TABLE users (
user_id INT PRIMARY KEY,
city_id INT -- nullable
Expand Down Expand Up @@ -28,7 +28,7 @@ FROM users
LEFT JOIN cities USING (city_id)
LEFT JOIN mayors USING (mayor_id);

-- https://github.com/kyleconroy/sqlc/issues/1334
-- https://github.com/sqlc-dev/sqlc/issues/1334
CREATE TABLE authors (
id INT PRIMARY KEY,
name TEXT NOT NULL,
Expand Down Expand Up @@ -77,7 +77,7 @@ FROM authors a
LEFT JOIN super_authors sa
ON a.parent_id = sa.super_id;

-- https://github.com/kyleconroy/sqlc/issues/1334
-- https://github.com/sqlc-dev/sqlc/issues/1334
CREATE TABLE "users_2" (
"user_id" uuid PRIMARY KEY,
"user_nickname" VARCHAR(30) UNIQUE NOT NULL,
Expand Down
6 changes: 3 additions & 3 deletions internal/endtoend/testdata/join_left/sqlite/query.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/604
-- https://github.com/sqlc-dev/sqlc/issues/604
CREATE TABLE users (
user_id INT PRIMARY KEY,
city_id INT -- nullable
Expand Down Expand Up @@ -29,7 +29,7 @@ FROM users
LEFT JOIN cities USING (city_id)
LEFT JOIN mayors USING (mayor_id);

-- https://github.com/kyleconroy/sqlc/issues/1334
-- https://github.com/sqlc-dev/sqlc/issues/1334
CREATE TABLE authors (
id INT PRIMARY KEY,
name TEXT NOT NULL,
Expand Down Expand Up @@ -78,7 +78,7 @@ FROM authors AS a
LEFT JOIN super_authors AS sa
ON a.parent_id = sa.super_id;

-- https://github.com/kyleconroy/sqlc/issues/1334
-- https://github.com/sqlc-dev/sqlc/issues/1334
CREATE TABLE users_2 (
user_id INT PRIMARY KEY,
user_nickname VARCHAR(30) UNIQUE NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/1198
-- https://github.com/sqlc-dev/sqlc/issues/1198
CREATE TABLE authors (
id INT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/921
-- https://github.com/sqlc-dev/sqlc/issues/921
CREATE TABLE authors (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name text NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/921
-- https://github.com/sqlc-dev/sqlc/issues/921
CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL UNIQUE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM authors
WHERE id = ?
LIMIT 1;

-- https://github.com/kyleconroy/sqlc/issues/1290
-- https://github.com/sqlc-dev/sqlc/issues/1290
CREATE TABLE users (
sub TEXT PRIMARY KEY
);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM authors
WHERE id = $1
LIMIT 1;

-- https://github.com/kyleconroy/sqlc/issues/1290
-- https://github.com/sqlc-dev/sqlc/issues/1290
CREATE TABLE users (
sub UUID PRIMARY KEY
);
Expand All @@ -28,7 +28,7 @@ FROM users
WHERE sub = $1
LIMIT 1;

-- https://github.com/kyleconroy/sqlc/issues/1235
-- https://github.com/sqlc-dev/sqlc/issues/1235

-- name: SetDefaultName :one
UPDATE authors
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM authors
WHERE id = $1
LIMIT 1;

-- https://github.com/kyleconroy/sqlc/issues/1290
-- https://github.com/sqlc-dev/sqlc/issues/1290
CREATE TABLE users (
sub UUID PRIMARY KEY
);
Expand All @@ -28,7 +28,7 @@ FROM users
WHERE sub = $1
LIMIT 1;

-- https://github.com/kyleconroy/sqlc/issues/1235
-- https://github.com/sqlc-dev/sqlc/issues/1235

-- name: SetDefaultName :one
UPDATE authors
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM authors
WHERE id = $1
LIMIT 1;

-- https://github.com/kyleconroy/sqlc/issues/1290
-- https://github.com/sqlc-dev/sqlc/issues/1290
CREATE TABLE users (
sub UUID PRIMARY KEY
);
Expand All @@ -28,7 +28,7 @@ FROM users
WHERE sub = $1
LIMIT 1;

-- https://github.com/kyleconroy/sqlc/issues/1235
-- https://github.com/sqlc-dev/sqlc/issues/1235

-- name: SetDefaultName :one
UPDATE authors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM authors
WHERE id = ?
LIMIT 1;

-- https://github.com/kyleconroy/sqlc/issues/1290
-- https://github.com/sqlc-dev/sqlc/issues/1290
CREATE TABLE users (
sub TEXT PRIMARY KEY
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/1590
-- https://github.com/sqlc-dev/sqlc/issues/1590
CREATE TABLE authors (
name text NOT NULL,
deleted_at datetime NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/upsert/sqlite/query.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- https://github.com/kyleconroy/sqlc/issues/1728
-- https://github.com/sqlc-dev/sqlc/issues/1728

CREATE TABLE IF NOT EXISTS locations (
id INTEGER PRIMARY KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FROM authors
GROUP BY name;


-- https://github.com/kyleconroy/sqlc/issues/1315
-- https://github.com/sqlc-dev/sqlc/issues/1315

CREATE TABLE IF NOT EXISTS weather_metrics
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ FROM authors
GROUP BY name;


-- https://github.com/kyleconroy/sqlc/issues/1315
-- https://github.com/sqlc-dev/sqlc/issues/1315

CREATE TABLE IF NOT EXISTS weather_metrics
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"name": "greeter",
"wasm": {
"url": "https://github.com/kyleconroy/sqlc-gen-greeter/releases/download/v0.1.0/sqlc-gen-greeter.wasm",
"url": "https://github.com/sqlc-dev/sqlc-gen-greeter/releases/download/v0.1.0/sqlc-gen-greeter.wasm",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"sha256": "afc486dac2068d741d7a4110146559d12a013fd0286f42a2fc7dcd802424ad07"
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ext/wasm/wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (r *Runner) loadWASM(ctx context.Context, cache string, expected string) ([
// 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/kyleconroy/sqlc/pull/1748
// @see https://github.com/sqlc-dev/sqlc/pull/1748
func removePGCatalog(req *plugin.CodeGenRequest) {
if req.Catalog == nil || req.Catalog.Schemas == nil {
return
Expand Down
6 changes: 3 additions & 3 deletions internal/inflection/singular.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ func Singular(s SingularParams) string {

// Manual fix for incorrect handling of "campus"
//
// https://github.com/kyleconroy/sqlc/issues/430
// https://github.com/sqlc-dev/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/kyleconroy/sqlc/issues/1217
// https://github.com/sqlc-dev/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/kyleconroy/sqlc/issues/2017
// https://github.com/sqlc-dev/sqlc/issues/2017
// https://github.com/jinzhu/inflection/issues/23
if strings.ToLower(s.Name) == "calories" {
return "calorie"
Expand Down
18 changes: 9 additions & 9 deletions internal/plugin/codegen.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions internal/tools/sqlc-pg-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const catalogTmpl = `
package {{.Pkg}}

import (
"github.com/kyleconroy/sqlc/internal/sql/ast"
"github.com/kyleconroy/sqlc/internal/sql/catalog"
"github.com/sqlc-dev/sqlc/internal/sql/ast"
"github.com/sqlc-dev/sqlc/internal/sql/catalog"
)

var funcs{{.GenFnName}} = []*catalog.Function {
Expand Down Expand Up @@ -119,8 +119,8 @@ const loaderFuncTmpl = `
package postgresql

import (
"github.com/kyleconroy/sqlc/internal/engine/postgresql/contrib"
"github.com/kyleconroy/sqlc/internal/sql/catalog"
"github.com/sqlc-dev/sqlc/internal/engine/postgresql/contrib"
"github.com/sqlc-dev/sqlc/internal/sql/catalog"
)

func loadExtension(name string) *catalog.Schema {
Expand Down
Loading
Loading