Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.

Commit fab7c4f

Browse files
authored
Merge pull request #11 from Avunu/turso-support
Turso support
2 parents c977328 + 7eea5e7 commit fab7c4f

42 files changed

Lines changed: 6365 additions & 65 deletions

Some content is hidden

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

‎.github/workflows/cs.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Install PHP
4949
uses: shivammathur/setup-php@v2
5050
with:
51-
php-version: '7.4'
51+
php-version: '8.1'
5252
coverage: none
5353
tools: cs2pr
5454

‎.github/workflows/d1-backend-tests.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
strategy:
6262
fail-fast: false
6363
matrix:
64-
php: [ '7.2', '8.1', '8.4' ]
64+
php: [ '8.0', '8.1', '8.4' ]
6565
steps:
6666
- uses: actions/checkout@v4
6767

‎.github/workflows/mysql-parser-tests.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
php: [ '7.2', '8.5' ]
35+
php: [ '8.0', '8.5' ]
3636

3737
steps:
3838
- name: Checkout repository

‎.github/workflows/mysql-proxy-tests.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up PHP
2626
uses: shivammathur/setup-php@v2
2727
with:
28-
php-version: '7.2'
28+
php-version: '8.0'
2929
coverage: none
3030

3131
- name: Configure monorepo package repository

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ jobs:
4242
matrix:
4343
include:
4444
# Pure-PHP parser, across the supported PHP versions, each pinned to a
45-
# representative SQLite version spanning the supported range.
46-
- { php: '7.2', sqlite: '3.27.0', extension: false } # minimum with WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS
47-
- { php: '7.3', sqlite: '3.31.1', extension: false } # Ubuntu 20.04 LTS
48-
- { php: '7.4', sqlite: '3.34.1', extension: false } # Debian 11 (Bullseye)
45+
# representative SQLite version spanning the supported range. PHP 8.0
46+
# is the floor: this fork does not carry the 7.x series.
4947
- { php: '8.0', sqlite: '3.37.0', extension: false } # minimum supported version (STRICT tables)
5048
- { php: '8.1', sqlite: '3.40.1', extension: false } # Debian 12 (Bookworm)
5149
- { php: '8.2', sqlite: '3.45.1', extension: false } # Ubuntu 24.04 LTS
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Turso Backend Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
- d1-support
8+
- turso-support
9+
paths:
10+
- '.github/workflows/turso-backend-tests.yml'
11+
- 'packages/mysql-on-sqlite/**'
12+
- 'packages/turso-snapshot-publisher/**'
13+
pull_request:
14+
paths:
15+
- '.github/workflows/turso-backend-tests.yml'
16+
- 'packages/mysql-on-sqlite/**'
17+
- 'packages/turso-snapshot-publisher/**'
18+
workflow_dispatch:
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
permissions: {}
25+
26+
jobs:
27+
# The driver test suites running against the Turso connection backend
28+
# (over the fake Turso transport; no server needed).
29+
driver-suites:
30+
name: Driver suites on Turso backend / PHP ${{ matrix.php }}
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 30
33+
permissions:
34+
contents: read
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
php: [ '8.0', '8.1', '8.4' ]
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: shivammathur/setup-php@v2
43+
with:
44+
php-version: ${{ matrix.php }}
45+
extensions: pdo, pdo_sqlite, curl
46+
coverage: none
47+
48+
- name: Install dependencies
49+
working-directory: packages/mysql-on-sqlite
50+
run: composer install --prefer-dist --no-progress
51+
52+
- name: Run the driver suites against the Turso backend
53+
working-directory: packages/mysql-on-sqlite
54+
env:
55+
WP_SQLITE_TEST_BACKEND: turso
56+
run: ./vendor/bin/phpunit tests/WP_MySQL_On_SQLite_Tests.php tests/WP_MySQL_On_SQLite_Query_Tests.php tests/WP_MySQL_On_SQLite_Metadata_Tests.php tests/WP_MySQL_On_SQLite_PDO_API_Tests.php
57+
58+
# The snapshot publisher: lint and build. It is exercised against a real
59+
# server by src/turso/verify-against-server.php, which needs a tursodb; that
60+
# stays a local check until one is packaged for CI.
61+
publisher:
62+
name: Snapshot publisher
63+
runs-on: ubuntu-latest
64+
timeout-minutes: 30
65+
permissions:
66+
contents: read
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Install Rust toolchain
71+
uses: dtolnay/rust-toolchain@stable
72+
with:
73+
components: rustfmt, clippy
74+
75+
- uses: Swatinem/rust-cache@v2
76+
with:
77+
workspaces: packages/turso-snapshot-publisher
78+
79+
- name: Lint
80+
working-directory: packages/turso-snapshot-publisher
81+
run: cargo fmt --check && cargo clippy --no-deps -- -D warnings
82+
83+
- name: Build
84+
working-directory: packages/turso-snapshot-publisher
85+
run: cargo build --release
86+
87+
- name: Smoke test
88+
working-directory: packages/turso-snapshot-publisher
89+
run: ./target/release/turso-snapshot-publisher --help

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ composer.lock
1313
/packages/d1-proxy-worker/node_modules/
1414
/packages/d1-proxy-worker/.wrangler/
1515
/packages/php-ext-wp-d1-client/target/
16+
/packages/turso-snapshot-publisher/target/

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The monorepo packages are placed under the `packages` directory.
2424
The WordPress plugin links the MySQL on SQLite package using a symlink. The build
2525
script replaces the symlink with a copy of the package for release.
2626

27-
The codebase is pure PHP with zero dependencies. It supports PHP 7.2 through 8.5,
27+
The codebase is pure PHP with zero dependencies. It supports PHP 8.0 through 8.5,
2828
MySQL syntax from version 5.7 onward, and requires SQLite 3.37.0 or newer
2929
(with legacy mode down to 3.27.0).
3030

@@ -177,7 +177,7 @@ In particular:
177177
- **PDO API:** MySQL on SQLite must match the PDO MySQL driver API as closely as possible.
178178
- **MySQL binary protocol:** The MySQL proxy must follow the MySQL binary protocol
179179
as closely as possible.
180-
- **PHP version support:** All PHP versions starting from **PHP 7.2** must be supported.
180+
- **PHP version support:** All PHP versions starting from **PHP 8.0** must be supported. This fork does not carry the 7.x series; the `PHP_VERSION_ID < 80000` shims that remain are inherited and may be removed.
181181
It is possible to use PHP version checks when needed.
182182
- **SQLite version support:** All SQLite versions starting from **SQLite 3.37.0** must be
183183
supported. Older versions (down to 3.27.0) have limited compatibility and require setting

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The monorepo packages are placed under the `packages` directory.
2222
The WordPress plugin links the MySQL on SQLite package using a symlink. The build
2323
script replaces the symlink with a copy of the package for release.
2424

25-
The codebase is pure PHP with zero dependencies. It supports PHP 7.2 through 8.5,
25+
The codebase is pure PHP with zero dependencies. It supports PHP 8.0 through 8.5,
2626
MySQL syntax from version 5.7 onward, and requires SQLite 3.37.0 or newer
2727
(with legacy mode down to 3.27.0).
2828

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"issues": "https://github.com/wordpress/sqlite-database-integration/issues"
99
},
1010
"require": {
11-
"php": ">=7.2",
11+
"php": ">=8.0",
1212
"ext-pdo": "*",
1313
"ext-pdo_sqlite": "*"
1414
},

0 commit comments

Comments
 (0)