Repository navigation
Conversation
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
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).
Plugins that accept raw SQL written for MySQL (e.g. block_configurable_reports) fail on SQLite with errors such as "no such function: FROM_UNIXTIME". SQLite supports user defined functions, so register emulations of the most common MySQL date/time and string helpers on every connection: FROM_UNIXTIME, UNIX_TIMESTAMP, DATE_FORMAT, NOW, CURDATE, CURTIME, IF, MD5, CONCAT and CONCAT_WS. The emulations follow MySQL semantics (CONCAT returns NULL when any argument is NULL; unknown DATE_FORMAT specifiers yield the literal character; week-based specifiers are approximated with ISO-8601 equivalents). Registration prefers Pdo\Sqlite::createFunction() when available (PHP 8.4+) and falls back to PDO::sqliteCreateFunction().
erseco
force-pushed
the
feature/sqlite-moodle-53
branch
from
October 3, 2026 13:57
02065e4 to
811d479
Compare
erseco
changed the base branch from
feature/moodle-53-baseline
to
MOODLE_503_STABLE
October 3, 2026 13:57
erseco
added a commit
to erseco/alpine-moodle
that referenced
this pull request
Oct 3, 2026
ateeducacion/moodle#7 was rebased onto and retargeted to the upstream 5.3 stable branch.
erseco
added a commit
to erseco/alpine-moodle
that referenced
this pull request
Oct 3, 2026
* Stage Moodle 5.3 LTS default runtime and latest promotion * Align runtime documentation with the staged LTS promotion * Cover successive Moodle 5.3 prereleases and document preserved runtimes * Qualify Moodle 5.3 RC1 in the PHP 8.4 matrix and upgrade test * Qualify Moodle 5.3.0 stable for the LTS promotion Upstream released v5.3.0 and MOODLE_503_STABLE. Pin the PHP 8.4 CI matrix and the persistent 4.5 -> 5.3 upgrade test to the stable tag instead of RC1, and record the release in the promotion gate. Related: ateeducacion/moodle-playground#328 * Patch the newest environment block when main predates its own Upstream main moved to 6.0dev without a <MOODLE version="6.0"> block in environment.xml. Moodle then checks the newest block not above the running version (5.3), but the SQLite helper only patched an exact 6.0 block, so the CLI installer failed with "Error reading environment data (10)". Pick the same block Moodle resolves. * Point the 5.3 SQLite patch notes at MOODLE_503_STABLE ateeducacion/moodle#7 was rebased onto and retargeted to the upstream 5.3 stable branch. * Document PHP 8.4 as the default runtime with Moodle 5.3 LTS State up front that since v5.3.0 latest is Moodle 5.3 LTS on PHP 8.4, list the PHP version per image tag, and stop calling the PHP 8.4 page opt-in now that it is the default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port the existing main SQLite driver and its column-metadata/MySQL-function fixes onto the exact v5.3.0-beta tag. Declare SQLite in the 5.3 environment block, leaving 5.2 untouched.
Upstream has no MOODLE_503_STABLE yet. The temporary base feature/moodle-53-baseline is the unmodified beta tag. Retarget/rebase onto MOODLE_503_STABLE when upstream creates it; keep #1 (main) and #5 (5.2) independent. No existing branches were renamed.
Validation completed: clean cherry-picks, PHP lint of all six changed PHP files, XML assertions for the 5.3 vendor declaration, diff checks, and exact beta/PHP 8.4.21/SQLite container installation, HTTP, Moosh, status, code sync and restart. The companion suite also passed PostgreSQL 17, MariaDB 11.4 and a real persistent 4.5.14 → 5.3 beta upgrade with course/file/plugin preservation, cron and restart.
Container PR #171 · reproducible validation report · SQLITE-53.md in this branch.
Experimental backend for WASM/demo/testing, not production.