Skip to content

MDL-88218: Add experimental SQLite support for Moodle WASM environments (5.1)#2

Open
erseco wants to merge 6 commits into
MOODLE_501_STABLEfrom
MDL-88218-sqlite-501
Open

MDL-88218: Add experimental SQLite support for Moodle WASM environments (5.1)#2
erseco wants to merge 6 commits into
MOODLE_501_STABLEfrom
MDL-88218-sqlite-501

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 changed the base branch from main to MOODLE_501_STABLE March 14, 2026 12:01
The fetch_columns() method only queried sqlite_master for table
metadata, but SQLite stores temporary tables in sqlite_temp_master.
This caused "Table does not exist" errors when Moodle tried to
access 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().
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