snapshot of https://github.com/sqlc-dev/sqlc.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled

This commit is contained in:
upstream-mirror
2026-09-16 02:17:34 +05:00
commit 0f4df23290
7340 changed files with 238743 additions and 0 deletions

18
.github/workflows/buf.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: buf
on:
pull_request:
paths-ignore:
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: bufbuild/buf-setup-action@v1
with:
# buf-setup-action resolves the release download URL through the
# GitHub API. Without a token that request is anonymous and shares
# a rate limit with every other job on the runner's IP, so setup
# intermittently fails with "API rate limit exceeded".
github_token: ${{ github.token }}
- uses: bufbuild/buf-lint-action@v1

19
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: build
on:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-24.04, macos-14, windows-2022]
name: build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: '1.26.5'
- name: install ./...
run: go build ./...
env:
CGO_ENABLED: "0"

31
.github/workflows/ci-kotlin.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: kotlin
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
jobs:
build:
if: false
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: '1.26.5'
- name: install ./...
run: go install ./...
- uses: actions/checkout@v7
with:
repository: sqlc-dev/sqlc-gen-kotlin
path: kotlin
- run: make test
working-directory: kotlin
- run: sqlc diff
working-directory: kotlin/examples

30
.github/workflows/ci-python.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: python
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
jobs:
build:
if: false
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: '1.26.5'
- name: install ./...
run: go install ./...
- uses: actions/checkout@v7
with:
repository: sqlc-dev/sqlc-gen-python
path: python
- run: make test
working-directory: python
- run: sqlc diff
working-directory: python/examples

30
.github/workflows/ci-typescript.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: typescript
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
jobs:
build:
if: false
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: '1.26.5'
- name: install ./...
run: go install ./...
- uses: actions/checkout@v7
with:
repository: sqlc-dev/sqlc-gen-typescript
path: typescript
# v0.1.3
ref: daaf539092421adc15f6c3164279a3470716b560
- run: sqlc diff
working-directory: typescript/examples

74
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,74 @@
name: go
on:
push:
branches:
- main
pull_request:
jobs:
build:
strategy:
matrix:
goos: [darwin, linux, windows]
goarch: [amd64, arm64]
name: build ${{ matrix.goos }}/${{ matrix.goarch }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: '1.26.5'
- run: go build ./...
env:
CGO_ENABLED: "0"
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: '1.26.5'
- name: install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: install sqlc-gen-test
run: go install github.com/sqlc-dev/sqlc-gen-test@v0.1.0
- name: install test-json-process-plugin
run: go install ./scripts/test-json-process-plugin/
- name: install ./...
run: go install ./...
env:
CGO_ENABLED: "0"
- name: build internal/endtoend
run: go build ./...
working-directory: internal/endtoend/testdata
env:
CGO_ENABLED: "0"
- name: install databases
run: go run ./cmd/sqlc-test-setup install
- name: start databases
run: go run ./cmd/sqlc-test-setup start
- name: test ./...
run: gotestsum --junitfile junit.xml -- --tags=examples -timeout 20m -failfast ./...
env:
CI_SQLC_PROJECT_ID: ${{ secrets.CI_SQLC_PROJECT_ID }}
CI_SQLC_AUTH_TOKEN: ${{ secrets.CI_SQLC_AUTH_TOKEN }}
SQLC_AUTH_TOKEN: ${{ secrets.CI_SQLC_AUTH_TOKEN }}
POSTGRESQL_SERVER_URI: "postgres://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable"
MYSQL_SERVER_URI: "root:mysecretpassword@tcp(127.0.0.1:3306)/mysql?multiStatements=true&parseTime=true"
CGO_ENABLED: "0"
vuln_check:
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: golang/govulncheck-action@v1

192
.github/workflows/gen.yml vendored Normal file
View File

@@ -0,0 +1,192 @@
name: gen
on:
workflow_dispatch:
jobs:
postgresql:
name: generate postgresql dialect
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: internal/goldeneye/go.mod
check-latest: true
- run: go run ./cmd/goldeneye generate postgresql
working-directory: internal/goldeneye
env:
POSTGRESQL_SERVER_URI: postgres://postgres:postgres@localhost:${{ job.services.postgres.ports['5432'] }}/postgres?sslmode=disable
- name: Save results
uses: actions/upload-artifact@v7
with:
name: dialect-postgresql
path: internal/engine/postgresql/dialect
- name: Fail if the committed dialect differs
run: git add -N internal/engine/postgresql && git diff --exit-code --stat -- internal/engine/postgresql
mysql:
name: generate mysql dialect
runs-on: ubuntu-24.04
services:
mysql:
image: mysql:26.7
env:
MYSQL_ROOT_PASSWORD: mysecretpassword
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping -h 127.0.0.1 -pmysecretpassword" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: internal/goldeneye/go.mod
check-latest: true
- run: go run ./cmd/goldeneye generate mysql
working-directory: internal/goldeneye
env:
MYSQL_SERVER_URI: root:mysecretpassword@tcp(localhost:${{ job.services.mysql.ports['3306'] }})/mysql
- name: Save results
uses: actions/upload-artifact@v7
with:
name: dialect-mysql
path: internal/engine/dolphin/dialect
- name: Fail if the committed dialect differs
run: git add -N internal/engine/dolphin && git diff --exit-code --stat -- internal/engine/dolphin
clickhouse:
name: generate clickhouse dialect
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: internal/goldeneye/go.mod
check-latest: true
- run: go run ./cmd/goldeneye install clickhouse
working-directory: internal/goldeneye
- run: go run ./cmd/goldeneye generate clickhouse
working-directory: internal/goldeneye
- name: Save results
uses: actions/upload-artifact@v7
with:
name: dialect-clickhouse
path: internal/engine/clickhouse/dialect
- name: Fail if the committed dialect differs
run: git add -N internal/engine/clickhouse && git diff --exit-code --stat -- internal/engine/clickhouse
sqlite:
name: generate sqlite dialect
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: internal/goldeneye/go.mod
check-latest: true
- run: go run ./cmd/goldeneye install sqlite
working-directory: internal/goldeneye
- run: go run ./cmd/goldeneye generate sqlite
working-directory: internal/goldeneye
- name: Save results
uses: actions/upload-artifact@v7
with:
name: dialect-sqlite
path: internal/engine/sqlite/dialect
- name: Fail if the committed dialect differs
run: git add -N internal/engine/sqlite && git diff --exit-code --stat -- internal/engine/sqlite
mssql:
name: generate mssql dialect
runs-on: ubuntu-24.04
services:
mssql:
image: mcr.microsoft.com/mssql/server:2025-latest
env:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: Mysecretpassword1!
ports:
- 1433:1433
options: --health-cmd "/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P 'Mysecretpassword1!' -Q 'SELECT 1'" --health-interval 10s --health-timeout 5s --health-retries 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: internal/goldeneye/go.mod
check-latest: true
- run: go run ./cmd/goldeneye generate mssql
working-directory: internal/goldeneye
env:
MSSQL_SERVER_URI: sqlserver://sa:Mysecretpassword1!@localhost:${{ job.services.mssql.ports['1433'] }}?encrypt=disable
- name: Save results
uses: actions/upload-artifact@v7
with:
name: dialect-mssql
path: internal/engine/mssql/dialect
- name: Fail if the committed dialect differs
run: git add -N internal/engine/mssql && git diff --exit-code --stat -- internal/engine/mssql
spanner:
name: generate googlesql dialect
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: internal/goldeneye/go.mod
check-latest: true
# Spanner Omni is run the way its quickstart runs it, on the host
# network, since a service container cannot be given a command.
- name: Start Spanner Omni
run: |
docker run -d --name spanneromni --network host us-docker.pkg.dev/spanner-omni/images/spanner-omni:2026.r2.1-beta start-single-server
for i in $(seq 1 60); do
if docker exec spanneromni /google/spanner/bin/spanner databases list >/dev/null 2>&1; then exit 0; fi
sleep 5
done
docker logs spanneromni
exit 1
- run: go run ./cmd/goldeneye generate spanner
working-directory: internal/goldeneye
env:
SPANNER_SERVER_URI: localhost:15000
- name: Save results
uses: actions/upload-artifact@v7
with:
name: dialect-googlesql
path: internal/engine/googlesql/dialect
- name: Fail if the committed dialect differs
run: git add -N internal/engine/googlesql && git diff --exit-code --stat -- internal/engine/googlesql
duckdb:
name: generate duckdb dialect
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: internal/goldeneye/go.mod
check-latest: true
# The current build of DuckDB's v2.0 preview channel, until 2.0 is
# released: a later build than the dialect was generated from shows up
# as a difference.
- run: go run ./cmd/goldeneye install duckdb
working-directory: internal/goldeneye
- run: go run ./cmd/goldeneye generate duckdb
working-directory: internal/goldeneye
- name: Save results
uses: actions/upload-artifact@v7
with:
name: dialect-duckdb
path: internal/engine/duckdb/dialect
- name: Fail if the committed dialect differs
run: git add -N internal/engine/duckdb && git diff --exit-code --stat -- internal/engine/duckdb