Finding the SQLite version used by Web SQL in Chrome#
Google Chrome still includes support for Web SQL, the long since abandoned proposed standard for shipping a SQL engine in browser JavaScript. I was reminded of its existence today while reading about the new official sqlite3 wasm build.
Out of curiosity, I decided to see what version of SQLite was bundled with Chrome. I assumed it would be a very old version, since Web SQL is an idea from a long time ago now.
I used GitHub Copilot to write the code, so I wouldn’t have to look up the APIs myself. I typed these two comments:
1// Instantiate a new WebSQL database2...3// Execute a SQL query returning sqlite_version()
Copilot completed the following:
1// Instantiate a new WebSQL database2var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);3// Execute a SQL query returning sqlite_version()4db.transaction(function (tx) {5 tx.executeSql(6 'SELECT sqlite_version()',7 [],8 function (tx, results) {9 console.log(results.rows.item(0));10 }11 );12});
I pasted that into my Chrome DevTools console… and got the following result:
1{sqlite_version(): '3.39.4'}
This surprised my greatly, because SQLite 3.39.4 is the most recent release, and only came out a month ago on the 29th of September 2022!
I had a look on GitHub and found this commit from the 30th of September which bumps the version of SQLite included in Chromium.
My Chrome is version 107.0.5304.62 - I found the SQLite 3.39.4 upgrade mentioned in this log of commits between v106 and v107, which was linked to from this release post.