Skip to content

Commit 0497aff

Browse files
committed
Switch to Turso main (pinned) with TEMP-table support
Pin Turso at 375f5d55 on main. Release v0.5.3 doesn't expose sqlite_temp_master, which the driver queries heavily; PR #6323 (merged 2026-04-13) implements TEMP tables and adds the legacy name. That alone should reclaim the ~250 'no such table: sqlite_temp_master' errors. Also drop the sqlite3_value_int / sqlite3_result_int wrappers from the shim — main exports both directly.
1 parent a07b6bd commit 0497aff

1 file changed

Lines changed: 12 additions & 25 deletions

File tree

.github/workflows/phpunit-tests-turso.yml

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ jobs:
2323
- name: Install Rust toolchain
2424
uses: dtolnay/rust-toolchain@stable
2525

26-
- name: Determine latest Turso release
26+
# Pinned to a specific main commit rather than a release tag. The latest
27+
# stable release (v0.5.3) lacks TEMP-table / sqlite_temp_master support
28+
# (added in PR #6323), which this driver relies on heavily. Bump this
29+
# SHA to pull in newer Turso fixes.
30+
- name: Set Turso commit to build
2731
id: turso
28-
env:
29-
GH_TOKEN: ${{ github.token }}
30-
run: |
31-
TAG=$(gh release view --repo tursodatabase/turso --json tagName --jq .tagName)
32-
echo "Using Turso release: $TAG"
33-
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
32+
run: echo "sha=375f5d55e26aa90c54abaadce7e035d8d0c6893d" >> "$GITHUB_OUTPUT"
3433

3534
- name: Cache Turso build
3635
uses: actions/cache@v4
@@ -39,10 +38,12 @@ jobs:
3938
~/.cargo/registry
4039
~/.cargo/git
4140
turso/target
42-
key: turso-${{ runner.os }}-${{ steps.turso.outputs.tag }}-${{ hashFiles('.github/workflows/phpunit-tests-turso.yml') }}
41+
key: turso-${{ runner.os }}-${{ steps.turso.outputs.sha }}-${{ hashFiles('.github/workflows/phpunit-tests-turso.yml') }}
4342

4443
- name: Clone Turso source
45-
run: git clone --depth 1 --branch '${{ steps.turso.outputs.tag }}' https://github.com/tursodatabase/turso.git
44+
run: |
45+
git clone --filter=blob:none https://github.com/tursodatabase/turso.git
46+
git -C turso checkout '${{ steps.turso.outputs.sha }}'
4647
4748
# Turso's C API shim aborts the PHP process via Rust panics in several
4849
# places. These patches neutralise the ones pdo_sqlite trips over:
@@ -180,12 +181,6 @@ jobs:
180181
return sqlite3_create_collation_v2(db, name, enc, ctx, cmp, 0);
181182
}
182183
183-
extern long long sqlite3_value_int64(sqlite3_value *v);
184-
int sqlite3_value_int(sqlite3_value *v) { return (int)sqlite3_value_int64(v); }
185-
186-
extern void sqlite3_result_int64(sqlite3_context *ctx, long long v);
187-
void sqlite3_result_int(sqlite3_context *ctx, int v) { sqlite3_result_int64(ctx, (long long)v); }
188-
189184
// SQLite's own formatting API. Turso doesn't export it. A naive
190185
// libc-only wrapper breaks because SQLite defines extra conversion
191186
// specifiers (%q, %Q, %w) that libc vsnprintf doesn't understand —
@@ -433,17 +428,9 @@ jobs:
433428
working-directory: packages/mysql-on-sqlite
434429
run: |
435430
python3 - <<'PY'
436-
# Abandoned driver patches:
437-
# - temporary_table_exists → false triggers a Turso mid-run mutex
438-
# deadlock. Leaving the query in place; the resulting 250 errors
439-
# are preferable to an indefinite hang.
440-
# - sync_column_key_info UPDATE rewrite triggers a Turso query-
441-
# planner pathological case; similar hang.
442-
# Only the wp_die polyfill is safe (it doesn't alter query flow).
443-
444431
# wp_die polyfill: real WordPress provides wp_die(); the unit-test
445-
# bootstrap doesn't, so 21 tests hit an 'undefined function' error
446-
# when a driver error path tries to call it.
432+
# bootstrap doesn't, so tests hit an 'undefined function' error when
433+
# a driver error path tries to call it.
447434
path = 'tests/bootstrap.php'
448435
src = open(path).read()
449436
marker = "if ( ! function_exists( 'do_action' ) ) {"

0 commit comments

Comments
 (0)