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
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:
88
.github/ISSUE_TEMPLATE/BUG_REPORT.yml
vendored
Normal file
88
.github/ISSUE_TEMPLATE/BUG_REPORT.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
name: Bug Report
|
||||
description: File a bug report
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: dropdown
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: What version of sqlc are you running? If you don't know, run `sqlc version`.
|
||||
multiple: false
|
||||
options:
|
||||
- 1.31.1
|
||||
- 1.31.0
|
||||
- 1.30.0
|
||||
- 1.29.0
|
||||
- 1.28.0
|
||||
- 1.27.0
|
||||
- 1.26.0
|
||||
- 1.25.0
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: What happened?
|
||||
description: Also tell us, what did you expect to happen?
|
||||
placeholder: Tell us what you see!
|
||||
value: "A bug happened!"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Relevant log output
|
||||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
||||
render: shell
|
||||
- type: textarea
|
||||
id: schema
|
||||
attributes:
|
||||
label: Database schema
|
||||
description: Please include definitions for the relevant database tables. This will be automatically formatted as SQL, so no need for backticks.
|
||||
render: sql
|
||||
- type: textarea
|
||||
id: queries
|
||||
attributes:
|
||||
label: SQL queries
|
||||
description: Please include the SQL queries causing issues. This will be automatically formatted as SQL, so no need for backticks.
|
||||
render: sql
|
||||
- type: textarea
|
||||
id: config
|
||||
attributes:
|
||||
label: Configuration
|
||||
description: Please include the sqlc.(yaml|yml) or sqlc.json file you using in your project. This will be automatically formatted, so no need for backticks.
|
||||
render: yaml
|
||||
- type: input
|
||||
id: playground
|
||||
attributes:
|
||||
label: Playground URL
|
||||
description: "Link to a reproduction of the issue on the sqlc playground"
|
||||
placeholder: "https://play.sqlc.dev/"
|
||||
- type: dropdown
|
||||
id: os
|
||||
attributes:
|
||||
label: What operating system are you using?
|
||||
multiple: true
|
||||
options:
|
||||
- Linux
|
||||
- Windows
|
||||
- macOS
|
||||
- type: dropdown
|
||||
id: engines
|
||||
attributes:
|
||||
label: What database engines are you using?
|
||||
multiple: true
|
||||
options:
|
||||
- MySQL
|
||||
- PostgreSQL
|
||||
- SQLite
|
||||
- type: dropdown
|
||||
id: languages
|
||||
attributes:
|
||||
label: What type of code are you generating?
|
||||
multiple: true
|
||||
options:
|
||||
- Go
|
||||
- Python
|
||||
- Kotlin
|
||||
30
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml
vendored
Normal file
30
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Feature Request
|
||||
description: Request a new feature or a change to an existing feature
|
||||
labels: [enhancement]
|
||||
body:
|
||||
- type: textarea
|
||||
id: feature
|
||||
attributes:
|
||||
label: What do you want to change?
|
||||
placeholder: Tell us what you want
|
||||
value: "Free unicorns!"
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: engines
|
||||
attributes:
|
||||
label: What database engines need to be changed?
|
||||
multiple: true
|
||||
options:
|
||||
- PostgreSQL
|
||||
- MySQL
|
||||
- SQLite
|
||||
- type: dropdown
|
||||
id: languages
|
||||
attributes:
|
||||
label: What programming language backends need to be changed?
|
||||
multiple: true
|
||||
options:
|
||||
- Go
|
||||
- Python
|
||||
- Kotlin
|
||||
20
.github/dependabot.yml
vendored
Normal file
20
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
groups:
|
||||
production-dependencies:
|
||||
dependency-type: "production"
|
||||
development-dependencies:
|
||||
dependency-type: "development"
|
||||
- package-ecosystem: "docker"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
|
||||
18
.github/workflows/buf.yml
vendored
Normal file
18
.github/workflows/buf.yml
vendored
Normal 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
19
.github/workflows/build.yml
vendored
Normal 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
31
.github/workflows/ci-kotlin.yml
vendored
Normal 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
30
.github/workflows/ci-python.yml
vendored
Normal 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
30
.github/workflows/ci-typescript.yml
vendored
Normal 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
74
.github/workflows/ci.yml
vendored
Normal 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
192
.github/workflows/gen.yml
vendored
Normal 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
|
||||
Reference in New Issue
Block a user