Skip to content

MDL-88218: Add experimental SQLite support for Moodle WASM environments (main)#1

Open
erseco wants to merge 5 commits into
mainfrom
MDL-88218-Add-experimental-SQLite-support-for-Moodle-WASM-environments
Open

MDL-88218: Add experimental SQLite support for Moodle WASM environments (main)#1
erseco wants to merge 5 commits into
mainfrom
MDL-88218-Add-experimental-SQLite-support-for-Moodle-WASM-environments

Conversation

@erseco

@erseco erseco commented Mar 14, 2026

Copy link
Copy Markdown
Member

Reintroduces experimental SQLite support via PDO, intended for WASM-based and other constrained ephemeral runtimes.

  • Adds SQLite 3 (PDO) as an installer database option
  • Restores SQLite DML driver and DDL generator
  • Fixes transaction result handling in pdo_moodle_database

This is not proposed as a production database backend. It targets portable demos, educational sandboxes, and local experimentation in WASM environments.

See tracker: MDL-88218

@erseco
erseco force-pushed the MDL-88218-Add-experimental-SQLite-support-for-Moodle-WASM-environments branch from 1ae328a to 2e0b63b Compare March 27, 2026 07:26
@erseco
erseco force-pushed the MDL-88218-Add-experimental-SQLite-support-for-Moodle-WASM-environments branch from 2e0b63b to 57750bb Compare April 4, 2026 09:00
@erseco
erseco force-pushed the MDL-88218-Add-experimental-SQLite-support-for-Moodle-WASM-environments branch 2 times, most recently from 3af3394 to e7ede2e Compare May 26, 2026 20:36
@erseco
erseco force-pushed the MDL-88218-Add-experimental-SQLite-support-for-Moodle-WASM-environments branch 2 times, most recently from 50d6314 to 1a24393 Compare June 4, 2026 15:52
Reintroduces experimental SQLite support via PDO, intended for
WASM-based and other constrained ephemeral runtimes (portable demos,
educational sandboxes, local experimentation). Not proposed as a
production database backend.

- Add SQLite 3 (PDO) as an installer database option
- Restore the SQLite DML driver and DDL generator
- Fix transaction result handling in pdo_moodle_database

Also fix fetch_columns() to find temporary tables in SQLite: it only
queried sqlite_master, but SQLite stores temporary tables in
sqlite_temp_master, causing "Table does not exist" errors when Moodle
accessed temporary tables (e.g. backup_ids_temp during activity
duplication). Add UNION ALL with sqlite_temp_master, consistent with
the existing pattern in get_tables().

See tracker: MDL-88218
@erseco
erseco force-pushed the MDL-88218-Add-experimental-SQLite-support-for-Moodle-WASM-environments branch from 1a24393 to 714f178 Compare June 5, 2026 20:12
erseco added 2 commits July 11, 2026 09:34
database_column_info::__construct() reads its fields via object property access,
so the SQLite driver's fetch_columns() must pass an object like the pgsql and
mysqli drivers do. Passing the raw array left every property (including ->name)
null, which broke callers reading $column->name (e.g. theme_snap's events query
produced 'SELECT e., e., ...' and a syntax error).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant