Skip to content

Commit 350401a

Browse files
committed
Merge branch 'main' into fix-embed-naming
2 parents 32079a0 + c582986 commit 350401a

File tree

2,933 files changed

+12398
-7699
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,933 files changed

+12398
-7699
lines changed

.github/ISSUE_TEMPLATE/BUG_REPORT.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Bug Report
22
description: File a bug report
3-
labels: [bug, triage]
3+
labels: [bug]
44
body:
55
- type: dropdown
66
id: version
@@ -9,6 +9,9 @@ body:
99
description: What version of sqlc are you running? If you don't know, run `sqlc version`.
1010
multiple: false
1111
options:
12+
- 1.27.0
13+
- 1.26.0
14+
- 1.25.0
1215
- 1.24.0
1316
- 1.23.0
1417
- 1.22.0

.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Feature Request
22
description: Request a new feature or a change to an existing feature
3-
labels: [enhancement, triage]
3+
labels: [enhancement]
44
body:
55
- type: textarea
66
id: feature

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "daily"
7+
groups:
8+
production-dependencies:
9+
dependency-type: "production"
10+
development-dependencies:
11+
dependency-type: "development"
712
- package-ecosystem: "docker"
813
directory: "/"
914
schedule:
@@ -21,3 +26,9 @@ updates:
2126
# sphinx
2227
- dependency-name: "docutils"
2328
- dependency-name: "sphinx"
29+
groups:
30+
production-dependencies:
31+
dependency-type: "production"
32+
development-dependencies:
33+
dependency-type: "development"
34+

.github/workflows/ci-typescript.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ jobs:
1919
with:
2020
repository: sqlc-dev/sqlc-gen-typescript
2121
path: typescript
22+
# v0.1.3
23+
ref: daaf539092421adc15f6c3164279a3470716b560
2224
- run: sqlc diff
2325
working-directory: typescript/examples

.github/workflows/ci.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ on:
77
jobs:
88
test:
99
strategy:
10-
max-parallel: 2
1110
matrix:
12-
os: [ubuntu-latest, macos-latest, windows-latest]
11+
# Disabling windows builds while we figure out why they're broken
12+
# os: [ubuntu-latest, macos-latest, windows-latest]
13+
os: [ubuntu-latest, macos-latest]
1314
cgo: ['1', '0']
1415
# Workaround no native support for conditional matrix items
1516
# https://github.com/orgs/community/discussions/26253#discussioncomment-6745038
@@ -29,8 +30,7 @@ jobs:
2930
- uses: actions/checkout@v4
3031
- uses: actions/setup-go@v5
3132
with:
32-
go-version-file: go.mod
33-
check-latest: true
33+
go-version: '1.22.5'
3434

3535
- name: install gotestsum
3636
run: go install gotest.tools/gotestsum@latest
@@ -49,12 +49,25 @@ jobs:
4949
env:
5050
CGO_ENABLED: ${{ matrix.cgo }}
5151

52+
# Start a PostgreSQL server
53+
- uses: sqlc-dev/action-setup-postgres@master
54+
with:
55+
postgres-version: "16"
56+
id: postgres
57+
58+
# Start a MySQL server
59+
- uses: shogo82148/actions-setup-mysql@v1
60+
with:
61+
mysql-version: "8.1"
62+
5263
- name: test ./...
5364
run: gotestsum --junitfile junit.xml -- --tags=examples -timeout 20m ./...
5465
env:
5566
CI_SQLC_PROJECT_ID: ${{ secrets.CI_SQLC_PROJECT_ID }}
5667
CI_SQLC_AUTH_TOKEN: ${{ secrets.CI_SQLC_AUTH_TOKEN }}
5768
SQLC_AUTH_TOKEN: ${{ secrets.CI_SQLC_AUTH_TOKEN }}
69+
MYSQL_SERVER_URI: root:@tcp(localhost:3306)/mysql?multiStatements=true&parseTime=true
70+
POSTGRESQL_SERVER_URI: ${{ steps.postgres.outputs.connection-uri }}?sslmode=disable
5871
CGO_ENABLED: ${{ matrix.cgo }}
5972

6073
vuln_check:
@@ -65,7 +78,6 @@ jobs:
6578
- uses: actions/checkout@v4
6679
- uses: actions/setup-go@v5
6780
with:
68-
go-version-file: go.mod
69-
check-latest: true
81+
go-version: '1.22.5'
7082
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
7183
- run: govulncheck ./...

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# STEP 1: Build sqlc
2-
FROM golang:1.21.5 AS builder
2+
FROM golang:1.22.6 AS builder
33

44
COPY . /workspace
55
WORKDIR /workspace
@@ -13,7 +13,7 @@ ENV VERSION=$version
1313
RUN go run scripts/release.go -docker
1414

1515
# STEP 2: Build a tiny image
16-
FROM scratch
16+
FROM gcr.io/distroless/base-debian12
1717

1818
COPY --from=builder /workspace/sqlc /workspace/sqlc
1919
ENTRYPOINT ["/workspace/sqlc"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Riza, Inc.
3+
Copyright (c) 2024 Riza, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build build-endtoend test test-ci test-examples test-endtoend regen start psql mysqlsh proto
1+
.PHONY: build build-endtoend test test-ci test-examples test-endtoend start psql mysqlsh proto
22

33
build:
44
go build ./...
@@ -9,6 +9,9 @@ install:
99
test:
1010
go test ./...
1111

12+
test-managed:
13+
MYSQL_SERVER_URI="invalid" POSTGRESQL_SERVER_URI="postgres://postgres:mysecretpassword@localhost:5432/postgres" go test -v ./...
14+
1215
vet:
1316
go vet ./...
1417

@@ -20,9 +23,6 @@ build-endtoend:
2023

2124
test-ci: test-examples build-endtoend vet
2225

23-
regen: sqlc-dev sqlc-gen-json
24-
go run ./scripts/regenerate/
25-
2626
sqlc-dev:
2727
go build -o ~/bin/sqlc-dev ./cmd/sqlc/
2828

README.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,44 @@ Check out [an interactive example](https://play.sqlc.dev/) to see it in action,
2020
- [Downloads](https://downloads.sqlc.dev/)
2121
- [Community](https://discord.gg/EcXzGe5SEs)
2222

23-
## Acknowledgments
24-
25-
sqlc was inspired by [PugSQL](https://pugsql.org/) and
26-
[HugSQL](https://www.hugsql.org/).
23+
## Supported languages
24+
25+
- [sqlc-gen-go](https://github.com/sqlc-dev/sqlc-gen-go)
26+
- [sqlc-gen-kotlin](https://github.com/sqlc-dev/sqlc-gen-kotlin)
27+
- [sqlc-gen-python](https://github.com/sqlc-dev/sqlc-gen-python)
28+
- [sqlc-gen-typescript](https://github.com/sqlc-dev/sqlc-gen-typescript)
29+
30+
Additional languages can be added via [plugins](https://docs.sqlc.dev/en/latest/reference/language-support.html#community-language-support).
31+
32+
## Sponsors
33+
34+
Development is possible thanks to our sponsors. If you would like to support sqlc,
35+
please consider [sponsoring on GitHub](https://github.com/sponsors/kyleconroy).
36+
37+
<p align="center">
38+
<a href="https://riza.io?utm_source=sqlc+readme"><img width=400 src="https://sqlc.dev/sponsors/riza-readme.png" alt="Riza.io"></a>
39+
</p>
40+
41+
<p align="center">
42+
<a href="https://coder.com?utm_source=sqlc+readme"><img width=200 src="https://sqlc.dev/sponsors/coder-readme.png" alt="Coder.com" /></a>
43+
<a href="https://mint.fun?utm_source=sqlc+readme"><img width=200 src="https://sqlc.dev/sponsors/mint-readme.png" alt="Mint.fun" /></a>
44+
<a href="https://mux.com?utm_source=sqlc+readme"><img width=200 src="https://sqlc.dev/sponsors/mux-readme.png" alt="Mux.com" /></a>
45+
</p>
46+
47+
<p align="center">
48+
<a href="https://github.com/Cyberax">Cyberax</a> -
49+
<a href="https://github.com/NaNuNaNu">NaNuNaNu</a> -
50+
<a href="https://github.com/Stumble">Stumble</a> -
51+
<a href="https://github.com/WestfalNamur">WestfalNamur</a> -
52+
<a href="https://github.com/alecthomas">alecthomas</a> -
53+
<a href="https://github.com/cameronnewman">cameronnewman</a> -
54+
<a href="https://github.com/danielbprice">danielbprice</a> -
55+
<a href="https://github.com/davherrmann">davherrmann</a> -
56+
<a href="https://github.com/dvob">dvob</a> -
57+
<a href="https://github.com/gilcrest">gilcrest</a> -
58+
<a href="https://github.com/gzuidhof">gzuidhof</a> -
59+
<a href="https://github.com/jeffreylo">jeffreylo</a> -
60+
<a href="https://github.com/mmcloughlin">mmcloughlin</a> -
61+
<a href="https://github.com/ryohei1216">ryohei1216</a> -
62+
<a href="https://github.com/sgielen">sgielen</a>
63+
</p>

docker-compose.yml

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,72 +10,12 @@ services:
1010
MYSQL_ROOT_PASSWORD: mysecretpassword
1111
MYSQL_ROOT_HOST: '%'
1212

13-
mysql5:
14-
image: "mysql/mysql-server:5.7"
15-
ports:
16-
- "3305:3306"
17-
restart: always
18-
environment:
19-
MYSQL_DATABASE: dinotest
20-
MYSQL_ROOT_PASSWORD: mysecretpassword
21-
MYSQL_ROOT_HOST: '%'
22-
profiles:
23-
- mysql
24-
2513
postgresql:
26-
image: "postgres:15"
14+
image: "postgres:16"
2715
ports:
2816
- "5432:5432"
2917
restart: always
3018
environment:
3119
POSTGRES_DB: postgres
3220
POSTGRES_PASSWORD: mysecretpassword
3321
POSTGRES_USER: postgres
34-
35-
postgresql14:
36-
image: "postgres:14"
37-
ports:
38-
- "5414:5432"
39-
restart: always
40-
environment:
41-
POSTGRES_DB: postgres
42-
POSTGRES_PASSWORD: mysecretpassword
43-
POSTGRES_USER: postgres
44-
profiles:
45-
- postgres
46-
47-
postgresql13:
48-
image: "postgres:13"
49-
ports:
50-
- "5413:5432"
51-
restart: always
52-
environment:
53-
POSTGRES_DB: postgres
54-
POSTGRES_PASSWORD: mysecretpassword
55-
POSTGRES_USER: postgres
56-
profiles:
57-
- postgres
58-
59-
postgresql12:
60-
image: "postgres:12"
61-
ports:
62-
- "5412:5432"
63-
restart: always
64-
environment:
65-
POSTGRES_DB: postgres
66-
POSTGRES_PASSWORD: mysecretpassword
67-
POSTGRES_USER: postgres
68-
profiles:
69-
- postgres
70-
71-
postgresql11:
72-
image: "postgres:11"
73-
ports:
74-
- "5411:5432"
75-
restart: always
76-
environment:
77-
POSTGRES_DB: postgres
78-
POSTGRES_PASSWORD: mysecretpassword
79-
POSTGRES_USER: postgres
80-
profiles:
81-
- postgres

docs/_static/customize.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@
1414
#banner > div > a {
1515
color: #F0F0F4;
1616
text-decoration: underline;
17-
}
17+
}
18+
19+
#sponsorship > img {
20+
width: 100%;
21+
max-width: 200px;
22+
}

docs/_templates/breadcrumbs.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
{% block breadcrumbs %}
44
{% if show_banner %}
5-
<header id="banner">
6-
<div>Introducing <a href="https://sqlc.dev/posts/2023/12/04/preview-typescript-support-with-sqlc-gen-typescript/">sqlc-gen-typescript</a>: Generate TypeScript from SQL.</div>
7-
</header>
85
{% endif %}
96
{{ super() }}
107
{% endblock %}

docs/_templates/layout.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
{% extends "!layout.html" %}
22

33
{% block extrahead %}
4-
<script defer data-domain="docs.sqlc.dev" src="https://plausible.io/js/plausible.js"></script>
4+
<script defer data-domain="docs.sqlc.dev" data-api="https://proxy.sqlc.dev/api/event" src="https://proxy.sqlc.dev/js/script.js"></script>
55
{{ super() }}
6-
{% endblock %}
6+
{% endblock %}
7+
8+
{% block menu %}
9+
{{ super() }}
10+
<p class="caption" role="heading"><span class="caption-text">Sponsored By</span></p>
11+
<div>
12+
<a id="sponsorship" href="https://riza.io?utm_source=sqlc+docs">
13+
<img src="https://sqlc.dev/sponsors/riza-readme.png" alt="Riza logo" />
14+
</a>
15+
</div>
16+
{% endblock %}

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
# -- Project information -----------------------------------------------------
1919

2020
project = 'sqlc'
21-
copyright = '2023, Riza, Inc.'
21+
copyright = '2024, Riza, Inc.'
2222
author = 'Riza, Inc.'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '1.24.0'
25+
release = '1.27.0'
2626

2727

2828
# -- General configuration ---------------------------------------------------

docs/guides/development.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ For local development, install `sqlc` under an alias. We suggest `sqlc-dev`.
88
go build -o ~/go/bin/sqlc-dev ./cmd/sqlc
99
```
1010

11+
Install `sqlc-gen-json` to avoid test failure.
12+
13+
```
14+
go build -o ~/go/bin/sqlc-gen-json ./cmd/sqlc-gen-json
15+
```
16+
1117
## Running Tests
1218

1319
```
@@ -53,16 +59,3 @@ MYSQL_USER root
5359
MYSQL_ROOT_PASSWORD mysecretpassword
5460
MYSQL_DATABASE dinotest
5561
```
56-
57-
## Regenerate expected test output
58-
59-
If you need to update a large number of expected test output in the
60-
`internal/endtoend/testdata` directory, run the `regenerate` script.
61-
62-
```
63-
go build -o ~/go/bin/sqlc-dev ./cmd/sqlc
64-
go run scripts/regenerate/main.go
65-
```
66-
67-
Note that this uses the `sqlc-dev` binary, not `sqlc` so make sure you have an
68-
up to date `sqlc-dev` binary.

0 commit comments

Comments
 (0)