Skip to content

Commit 8e87ac5

Browse files
CI: run codegen checks and E2E on macOS and Windows (#50)
## Summary CI now runs the codegen checks and every E2E suite on macOS and Windows as well as Linux. A new reusable workflow, `.github/workflows/cross-platform.yml`, is called from `build.yml` after `build-wasm`. It downloads the `plugin.wasm` built on Linux (the artifact a release publishes) and runs that exact file through sqlc on each OS. ### Matrix (OS × Ruby × DB) | OS | Ruby | PostgreSQL (`pg`) | MySQL (`mysql2`) | SQLite (`sqlite3`) | |---|---|---|---|---| | Linux (`tests.yml`, unchanged) | 3.1, 3.2, 3.3, 3.4, 4.0 (+ module-name / no-prepared variants) | 16, service container | 8.3, service container | ✓ | | macOS (`macos-latest`) | 3.1, 4.0 | 16 (`ankane/setup-postgres`) | 8.4 (`ankane/setup-mysql`) | ✓ | | Windows (`windows-latest`) | 3.1, 4.0 | 17 (`ankane/setup-postgres`; the only version on windows-2025) | 8.4, preinstalled on the image | ✓ | Every macOS/Windows × Ruby cell runs two jobs in parallel: * **Codegen**: unit + golden tests on that OS's Ruby, then `sqlc diff` with the Linux-built WASM and again with the process plugin (`exe\plugin.cmd` on Windows), plus the WASM codegen check for that Ruby version. * **End-to-End**: generates the examples with the WASM and runs the full SQLite, PostgreSQL and MySQL suites against native servers using the native `pg` / `mysql2` / `sqlite3` gems, then the generator-options E2E. **Why only Ruby 3.1 and 4.0 on macOS/Windows:** they are the oldest and newest supported versions. 3.1 is the `Struct` code path and has the old Bundler/default gems; 4.0 is the `Data` path with the newest stdlib/bundled-gem split. Ruby-version-specific behaviour is already covered on every version on Linux. What macOS/Windows add is OS behaviour (paths, line endings, native gems, client libraries, the fiber scheduler), and the two ends of the range cover that. The setup actions are pinned by SHA (`ankane/setup-postgres@b1a598d…`, `ankane/setup-mysql@4aa1b08…`, `sqlc-dev/setup-sqlc@bac53b7…`). MySQL gets `SET GLOBAL local_infile = 1` for `:copyfrom`. ### Hard limits Every job in `build.yml`, `tests.yml`, `cross-platform.yml`, `docs.yml` and `release.yml` now has `timeout-minutes: 10`. The slowest job is currently 3m49s. ### CI duration | | wall clock (first job start → last job end) | slowest jobs | |---|---|---| | `main` (60a6d90) | ~1m45s | Linux MySQL E2E Ruby 3.2: 72s | | this PR, first version (one job per OS × Ruby) | 7m31s | Windows Ruby 4.0: 6m18s, Windows Ruby 3.1: 5m31s | | this PR, now (gem cache hit) | **4m19s** | E2E Windows Ruby 4.0: 3m49s, E2E Windows Ruby 3.1: 3m09s, E2E macOS 3.1/4.0: ~2m, Codegen Windows: ~1m55s | These changes cut the first version's time: * **Codegen and E2E run as separate parallel jobs.** The unit/golden tests and `sqlc diff` (~1 min on Windows) are off the E2E critical path, and the Codegen jobs need no database setup. * **The E2E gems are cached** (`actions/cache`, keyed on runner image + Ruby + `Gemfile.e2e`). On Windows, prism, mysql2 and date compile from source, which took ~2 min per job. The key includes the image version because the native extensions link against the image's libraries. The remaining Windows time goes mostly to the MySQL suite (~1 min: `mysql2` queries don't overlap there, see below), PostgreSQL/MySQL/Ruby setup (~1.5 min) and the generator-options E2E. Linux `tests.yml` is unchanged (~1.5 min) and runs in parallel. ## OS-specific bugs found 1. **Fixed: mysql2 `:copyfrom` corrupted rows containing Ctrl-Z (`0x1A`) on Windows.** The client library reads the `LOAD DATA LOCAL INFILE` temp file in text mode on Windows, where a raw Ctrl-Z ends the file. The generated `csv_line` now writes it as `\Z`, which MySQL decodes back to `0x1A` on every OS. `examples/mysql2` and the golden files are regenerated, and `test_seeded_random_copyfrom_round_trip_and_duplicate_is_atomic` got a Ctrl-Z row. Before the fix, the seeded random binary payloads failed on Windows. 2. **Fixed: the process plugin could not run on Windows.** `exe/plugin.rb` cannot be executed directly there. The new `exe/plugin.cmd` (`@ruby "%~dp0plugin.rb" %*`, CRLF) wraps it. It must be referenced as `exe\plugin.cmd` because sqlc runs it through `cmd.exe`, which parses `exe/plugin.cmd` as a switch. 3. **Documented, not fixable in the plugin: `mysql2` queries don't run concurrently under `Sync` on Windows.** The pooled queries ran serially there (1.58s concurrent vs 1.55s serial). The `mysql2` C extension blocks the thread on Windows instead of yielding to the fiber scheduler. Results are still asserted on Windows; only the overlap assertion runs off Windows. The README's async note now says so. 4. **Test-suite fixes** (no generated-code change): * The SQLite E2E sometimes deadlocked on Ruby 3.1, on Linux too; this was the long-running job. A database left to the GC could be finalized on another thread while a timed-out SQL `sleep` held its mutex. The test now closes it in `teardown`. * `tests/rbs_types.rb` hit `File.read` → `EBADF` under the fiber scheduler on Windows Ruby 3.1. It now reads the `.rbs` files before queries run. * `Gemfile.e2e` needs `logger` and `bigdecimal` on Ruby ≥ 3.4/4.0, where they are no longer default gems. 5. **CI environment issues:** * `ankane/setup-mysql` fails on windows-2025 (`EPERM` renaming over the preinstalled 8.4), so the job starts the image's MySQL instead. * Ruby is set up after the databases. Otherwise PostgreSQL's bundled zlib/iconv DLLs shadow the MSYS2 toolchain's and gcc fails silently. * On Windows, `mysql2` is built against MSYS2's `libmariadbclient` with `--with-mysql-config`, because its extconf can't find `mariadb_config.exe` through PATH. * On macOS, `mysql2` gets `--with-opt-dir` for Homebrew's openssl/zstd. * `.gitattributes` keeps LF everywhere, so `sqlc diff` and the golden tests stay byte-for-byte equal on Windows checkouts. * `scripts/wasm/update_sha.sh` falls back to `shasum -a 256`. `docs/Testing.md` and `CLAUDE.md` describe the new jobs. The README changed only for the `mysql2`/Windows async note; it makes no other platform claims. ## Checklist - [x] `examples/` is regenerated (`rake sqlc_generate_process`) and committed - [x] Tests added or updated (`rake test`, and `rake end2end_*` when the generated code changes) - [x] The generated code stays RuboCop-clean (`rake rubocop`) and Steep-clean (`rake steep`) - [x] Labelled (`bug`, `enhancement`, `documentation`, or `breaking`) so the release notes are grouped correctly --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Doron Eli Rachman <doron050@gmail.com>
1 parent 60a6d90 commit 8e87ac5

22 files changed

Lines changed: 281 additions & 14 deletions

File tree

‎.gitattributes‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Generated code, golden files and sqlc configs are compared byte for byte (sqlc diff, golden tests):
2+
# keep LF on every OS, also on Windows checkouts with core.autocrlf.
3+
* text=auto eol=lf
4+
*.bin binary
5+
*.wasm binary
6+
*.cmd text eol=crlf

‎.github/workflows/build.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
build-wasm:
2525
name: Build (WASM)
2626
runs-on: ubuntu-latest
27+
timeout-minutes: 10
2728

2829
steps:
2930
- uses: actions/checkout@v7
@@ -46,6 +47,7 @@ jobs:
4647
lint:
4748
name: Lint
4849
runs-on: ubuntu-latest
50+
timeout-minutes: 10
4951

5052
steps:
5153
- uses: actions/checkout@v7
@@ -70,6 +72,7 @@ jobs:
7072
name: Codegen Tests
7173
needs: [build-wasm]
7274
runs-on: ubuntu-latest
75+
timeout-minutes: 10
7376

7477
steps:
7578
- uses: actions/checkout@v7
@@ -108,6 +111,7 @@ jobs:
108111
name: Codegen Options (ruby ${{ matrix.ruby-version }}, types=${{ matrix.generate-types }}, gemfile=${{ matrix.generate-gemfile }})
109112
needs: [build-wasm]
110113
runs-on: ubuntu-latest
114+
timeout-minutes: 10
111115

112116
strategy:
113117
fail-fast: false
@@ -146,3 +150,8 @@ jobs:
146150
run: >-
147151
./scripts/tests/run_codegen.rb sqlc.ci.yaml
148152
"${{ matrix.ruby-version }}" ${{ matrix.generate-types }} ${{ matrix.generate-gemfile }}
153+
154+
cross-platform:
155+
name: Cross-platform
156+
needs: [build-wasm]
157+
uses: ./.github/workflows/cross-platform.yml
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
name: Cross-platform
2+
3+
# Called by build.yml after build-wasm: macOS and Windows run the plugin.wasm built on Linux (the artifact a release
4+
# publishes) through sqlc, and the generated code against natively installed PostgreSQL / MySQL and SQLite.
5+
# The full Ruby / option matrix stays on Linux (tests.yml); here the oldest and newest supported Ruby.
6+
on:
7+
workflow_call:
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
permissions:
14+
contents: read
15+
16+
env:
17+
DB_NAME: tests
18+
DB_USER: root
19+
DB_PASS: pass # ignored by the servers below (trust / empty-password root), required by the pg tests' env
20+
POSTGRES_HOST: 127.0.0.1
21+
MYSQL_HOST: 127.0.0.1
22+
23+
jobs:
24+
codegen:
25+
name: Codegen (${{ matrix.os-name }}, Ruby ${{ matrix.ruby-version }})
26+
runs-on: ${{ matrix.os }}
27+
timeout-minutes: 10
28+
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
os: [macos-latest, windows-latest]
33+
ruby-version: ['3.1', '4.0']
34+
include:
35+
- { os: macos-latest, os-name: macOS }
36+
- { os: windows-latest, os-name: Windows }
37+
38+
steps:
39+
- uses: actions/checkout@v7
40+
41+
- name: Load tool versions
42+
run: grep -E '^[A-Z_]+=' scripts/tool-versions.env >> "$GITHUB_ENV"
43+
44+
- uses: sqlc-dev/setup-sqlc@bac53b7fb28c039a6c7f5736fd1e89744021bdd6 # v5.0.0
45+
with:
46+
sqlc-version: '${{ env.SQLC_VERSION }}'
47+
48+
- uses: ruby/setup-ruby@v1
49+
with:
50+
ruby-version: ${{ matrix.ruby-version }}
51+
52+
- uses: actions/download-artifact@v8
53+
with:
54+
name: wasm-file
55+
path: dist
56+
57+
- name: Updating plugin sha
58+
run: ./scripts/wasm/update_sha.sh sqlc.ci.yaml
59+
60+
# the process plugin on this OS's Ruby: no bundler, only the standard library + minitest
61+
- name: Unit & golden tests
62+
run: ruby -Ilib -Itest -e 'Dir["test/*_test.rb"].sort.each { |file| require File.expand_path(file) }'
63+
64+
# the committed examples/ (LF, byte for byte) must come out of sqlc + the Linux-built WASM on this OS too
65+
- name: Verify generated code is synced (WASM plugin)
66+
run: sqlc -f sqlc.ci.yaml diff
67+
68+
- name: Verify generated code is synced (process plugin)
69+
run: |
70+
if [ "${RUNNER_OS}" = Windows ]; then
71+
# Windows cannot execute plugin.rb directly: sqlc runs the exe\plugin.cmd wrapper (through cmd.exe, so backslashes)
72+
sed 's#cmd: ./exe/plugin.rb#cmd: exe\\plugin.cmd#' sqlc.local.yaml > .sqlc-windows.yaml
73+
trap 'rm -f .sqlc-windows.yaml' EXIT
74+
sqlc -f .sqlc-windows.yaml diff
75+
else
76+
sqlc -f sqlc.local.yaml diff
77+
fi
78+
79+
- name: Generate with the WASM for Ruby ${{ matrix.ruby-version }} and check the output
80+
run: ruby scripts/tests/run_codegen.rb sqlc.ci.yaml "${{ matrix.ruby-version }}" true true
81+
82+
end2end:
83+
name: End-to-End (${{ matrix.os-name }}, Ruby ${{ matrix.ruby-version }})
84+
runs-on: ${{ matrix.os }}
85+
timeout-minutes: 10
86+
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
os: [macos-latest, windows-latest]
91+
ruby-version: ['3.1', '4.0']
92+
include:
93+
- { os: macos-latest, os-name: macOS, postgres-version: '16' }
94+
- { os: windows-latest, os-name: Windows, postgres-version: '17' } # the only version on windows-2025
95+
96+
env:
97+
EXAMPLES_DIR: ${{ github.workspace }}/.examples-ruby-${{ matrix.ruby-version }}
98+
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.e2e
99+
BUNDLE_PATH: ${{ github.workspace }}/.e2e-gems
100+
101+
steps:
102+
- uses: actions/checkout@v7
103+
104+
- name: Load tool versions
105+
run: grep -E '^[A-Z_]+=' scripts/tool-versions.env >> "$GITHUB_ENV"
106+
107+
- uses: sqlc-dev/setup-sqlc@bac53b7fb28c039a6c7f5736fd1e89744021bdd6 # v5.0.0
108+
with:
109+
sqlc-version: '${{ env.SQLC_VERSION }}'
110+
111+
- uses: ankane/setup-postgres@b1a598d92f86cb2ed364411898d150d4eac6d5ca # v1
112+
with:
113+
postgres-version: ${{ matrix.postgres-version }}
114+
database: ${{ env.DB_NAME }}
115+
user: ${{ env.DB_USER }}
116+
117+
- uses: ankane/setup-mysql@4aa1b08412d4c8bf537fea5bc412e4e831d839d7 # v1
118+
if: runner.os != 'Windows'
119+
with:
120+
mysql-version: '8.4'
121+
database: ${{ env.DB_NAME }}
122+
user: ${{ env.DB_USER }}
123+
124+
# windows-2025 ships MySQL 8.4 (on PATH); setup-mysql only treats 8.0 as preinstalled there and fails to
125+
# reinstall 8.4 over it, so start the image's server the same way the action does
126+
- name: Start the preinstalled MySQL 8.4 (Windows)
127+
if: runner.os == 'Windows'
128+
shell: pwsh
129+
run: |
130+
$ErrorActionPreference = 'Stop'
131+
$PSNativeCommandUseErrorActionPreference = $true
132+
$bin = 'C:\Program Files\MySQL\MySQL Server 8.4\bin'
133+
& "$bin\mysqld" --initialize-insecure
134+
& "$bin\mysqld" --install
135+
net start MySQL
136+
& "$bin\mysqladmin" -u $env:DB_USER create $env:DB_NAME
137+
138+
# after the databases: their bin dirs (PostgreSQL ships its own zlib/iconv DLLs) must come after Ruby's MSYS2
139+
# toolchain on PATH, or gcc fails silently on Windows and no native gem builds
140+
- uses: ruby/setup-ruby@v1
141+
with:
142+
ruby-version: ${{ matrix.ruby-version }}
143+
144+
- uses: actions/download-artifact@v8
145+
with:
146+
name: wasm-file
147+
path: dist
148+
149+
- name: Updating plugin sha
150+
run: ./scripts/wasm/update_sha.sh sqlc.ci.yaml
151+
152+
# the E2E suites below run this WASM output, with the Gemfile it generates
153+
- name: Generate the E2E examples with the WASM
154+
run: ruby scripts/tests/generate_examples.rb "${{ matrix.ruby-version }}" sqlc.ci.yaml --generate-gemfile
155+
156+
- name: Create the schemas (and allow LOAD DATA LOCAL INFILE for :copyfrom)
157+
run: |
158+
psql -v ON_ERROR_STOP=1 -h "${POSTGRES_HOST}" -U "${DB_USER}" -d "${DB_NAME}" -f examples/authors/postgresql/schema.sql
159+
mysql -h "${MYSQL_HOST}" -u "${DB_USER}" -e 'SET GLOBAL local_infile = 1'
160+
mysql -h "${MYSQL_HOST}" -u "${DB_USER}" --default-character-set=utf8mb4 "${DB_NAME}" < examples/authors/mysql/schema.sql
161+
162+
- name: Native build settings for mysql2
163+
run: |
164+
if [ "${RUNNER_OS}" = Windows ]; then
165+
ridk.cmd exec pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-libmariadbclient
166+
# mysql2's extconf can't glob for mariadb_config.exe through Windows PATH entries, so point at it
167+
mariadb_config=$(cygpath -m "${RI_DEVKIT}/ucrt64/bin/mariadb_config.exe")
168+
test -x "${mariadb_config}"
169+
echo "BUNDLE_BUILD__MYSQL2=--with-mysql-config=${mariadb_config}" >> "$GITHUB_ENV"
170+
else
171+
echo "BUNDLE_BUILD__MYSQL2=--with-opt-dir=$(brew --prefix openssl@3):$(brew --prefix zstd)" >> "$GITHUB_ENV"
172+
fi
173+
174+
# prism (minitest 6), mysql2 and date compile from source on Windows (~2 min): keep the installed E2E gems, per runner
175+
# image (the native extensions link against its libraries)
176+
- name: Runner image
177+
id: image
178+
run: echo "version=${ImageOS}-${ImageVersion}" >> "$GITHUB_OUTPUT"
179+
180+
- uses: actions/cache@v6
181+
with:
182+
path: ${{ env.BUNDLE_PATH }}
183+
key: e2e-gems-${{ steps.image.outputs.version }}-ruby${{ matrix.ruby-version }}-${{ hashFiles('Gemfile.e2e') }}
184+
185+
- name: End-to-End tests (SQLite)
186+
if: ${{ !cancelled() }}
187+
env:
188+
EXAMPLES_DRIVER: sqlite3
189+
run: bundle install && bundle exec rake end2end_sqlite3
190+
191+
- name: End-to-End tests (PostgreSQL ${{ matrix.postgres-version }})
192+
if: ${{ !cancelled() }}
193+
env:
194+
EXAMPLES_DRIVER: pg
195+
run: bundle install && bundle exec rake end2end_pg
196+
197+
- name: End-to-End tests (MySQL 8.4)
198+
if: ${{ !cancelled() }}
199+
env:
200+
EXAMPLES_DRIVER: mysql2
201+
run: bundle install && bundle exec rake end2end_mysql2
202+
203+
- name: Generator options E2E
204+
if: ${{ !cancelled() }}
205+
env:
206+
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.options.e2e
207+
# default gem path (only prebuilt gems): with BUNDLE_PATH, the test's nested `bundle install` on Windows Ruby
208+
# 3.1 trips over setup-ruby's newer Bundler next to the default 2.3 one
209+
run: |
210+
unset BUNDLE_PATH
211+
bundle install && bundle exec ruby tests/end2end_options.rb
212+
213+
- name: Native extension build logs
214+
if: failure()
215+
run: find "$(ruby -e 'print Gem.dir')" -name mkmf.log -exec sh -c 'echo "== $1"; cat "$1"' _ {} \;

‎.github/workflows/docs.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
jobs:
2323
generate-docs:
2424
runs-on: ubuntu-latest
25+
timeout-minutes: 10
2526

2627
steps:
2728
- name: Checkout repository

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
plan:
4040
name: Plan
4141
runs-on: ubuntu-latest
42+
timeout-minutes: 10
4243
if: github.ref == 'refs/heads/main' # releases are cut from main only
4344
outputs:
4445
version: ${{ steps.next.outputs.version }}
@@ -74,6 +75,7 @@ jobs:
7475
name: Release ${{ needs.plan.outputs.version }}
7576
needs: [plan, build, tests]
7677
runs-on: ubuntu-latest
78+
timeout-minutes: 10
7779
permissions:
7880
contents: write # tag + release
7981
env:
@@ -140,6 +142,7 @@ jobs:
140142
needs: [plan, release]
141143
if: ${{ !inputs.dry_run && !inputs.draft }}
142144
runs-on: ubuntu-latest
145+
timeout-minutes: 10
143146
env:
144147
VERSION: ${{ needs.plan.outputs.version }}
145148
SHA256: ${{ needs.release.outputs.sha256 }}

‎.github/workflows/tests.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
unit-tests:
3030
name: Unit Tests
3131
runs-on: ubuntu-latest
32+
timeout-minutes: 10
3233

3334
steps:
3435
- uses: actions/checkout@v7
@@ -45,6 +46,7 @@ jobs:
4546
compatibility:
4647
name: Plugin on Ruby ${{ matrix.ruby-version }}
4748
runs-on: ubuntu-latest
49+
timeout-minutes: 10
4850

4951
strategy:
5052
fail-fast: false
@@ -65,6 +67,7 @@ jobs:
6567
end2end-pg:
6668
name: End-to-End (PostgreSQL, Ruby ${{ matrix.ruby-version }}, ${{ matrix.variant }})
6769
runs-on: ubuntu-latest
70+
timeout-minutes: 10
6871

6972
strategy:
7073
fail-fast: false
@@ -141,6 +144,7 @@ jobs:
141144
end2end-mysql:
142145
name: End-to-End (MySQL, Ruby ${{ matrix.ruby-version }}, ${{ matrix.variant }})
143146
runs-on: ubuntu-latest
147+
timeout-minutes: 10
144148

145149
strategy:
146150
fail-fast: false
@@ -215,6 +219,7 @@ jobs:
215219
end2end-sqlite:
216220
name: End-to-End (SQLite, Ruby ${{ matrix.ruby-version }}, ${{ matrix.variant }})
217221
runs-on: ubuntu-latest
222+
timeout-minutes: 10
218223

219224
strategy:
220225
fail-fast: false
@@ -269,6 +274,7 @@ jobs:
269274
end2end-options:
270275
name: Generator options E2E (Ruby ${{ matrix.ruby-version }})
271276
runs-on: ubuntu-latest
277+
timeout-minutes: 10
272278

273279
strategy:
274280
fail-fast: false

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,4 @@ plugins
145145
# scratch output of scripts/tests/run_codegen.rb
146146
.codegen-test*
147147
.examples-ruby-*
148+
.e2e-gems

‎CLAUDE.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ UPDATE_GOLDEN=1 bundle exec ruby -Itest test/extended_golden_test.rb # rewrite
4545
* Develop on a feature branch, small commits; PRs target `main`. Label PRs (`bug`, `enhancement`, `documentation`; `breaking` for incompatible changes, see `.github/release.yml`).
4646
* CI: `build.yml` (WASM, lint, `sqlc diff`, Steep, option matrix) and `tests.yml` (unit, compatibility Ruby
4747
3.1/3.2/3.4/4.0, full E2E Ruby 3.1–4.0, Ruby 4.0 module-name variants and PostgreSQL without prepared statements,
48-
plus generator-options E2E on Ruby 3.1/4.0 against PostgreSQL 16, MySQL 8.3 and SQLite). Both must be green.
48+
plus generator-options E2E on Ruby 3.1/4.0 against PostgreSQL 16, MySQL 8.3 and SQLite). `build.yml` also runs
49+
`cross-platform.yml`: the Linux-built WASM, the process plugin and all E2E suites on macOS and Windows (Ruby 3.1/4.0,
50+
native databases). All must be green; every job has `timeout-minutes: 10`.
4951
* **Never create tags or releases by hand and never add release markers to commit messages.** Releases are started by a
5052
maintainer with the *Release* workflow (`docs/Releasing.md`); do not trigger it unless explicitly asked.
5153
* Tool versions (sqlc, ruby.wasm) are pinned in `scripts/tool-versions.env`; bump them there only.

‎Gemfile.e2e‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ examples_dir = ENV.fetch('EXAMPLES_DIR') { raise 'EXAMPLES_DIR must point at gen
66
driver = ENV.fetch('EXAMPLES_DRIVER') { raise 'EXAMPLES_DRIVER must be set for E2E bundling' }
77
eval_gemfile File.join(examples_dir, driver, 'Gemfile')
88

9+
gem 'bigdecimal' # tests/; bundled (not default) gems since Ruby 3.4 / 4.0
10+
gem 'logger'
911
gem 'async', RUBY_VERSION.start_with?('3.1') ? '< 2.7' : '>= 2.7'
1012
gem 'minitest'
1113
gem 'rake'

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ per table, one module of constants per enum), `connection.rb` (shared helpers) a
102102
* **Logging:** `connect(params, logger: Rails.logger)` / `new(pool, logger:)` logs `QuerySql#get_author (0.4ms)` at
103103
debug level for each query and transaction. Parameter values are never logged.
104104
* **Async / fibers:** it is plain synchronous Ruby and works with the Fiber scheduler ([`async`](https://github.com/socketry/async)):
105-
inside `Sync { ... }`, pooled `pg` and `mysql2` queries run concurrently. MySQL parameters are quoted client-side
105+
inside `Sync { ... }`, pooled `pg` and `mysql2` queries run concurrently (`mysql2` blocks the thread on Windows). MySQL parameters are quoted client-side
106106
with `Mysql2::Client#escape` and sent with `Client#query`, not server-side prepared statements. SQLite queries run
107107
one at a time.
108108
* **Style:** SQL lives in frozen heredoc constants (`GET_AUTHOR_SQL`), comments above a query become its doc comment,

0 commit comments

Comments
 (0)