maubot / rss

A RSS plugin for maubot
GNU Affero General Public License v3.0
68 stars 21 forks source link

Fix compatibility with sqlite3 before v3.35 #31

Closed sumpfralle closed 2 years ago

sumpfralle commented 2 years ago

The language feature RETURNING was added to sqlite3 in release v3.35. See https://www.sqlite.org/draft/lang_returning.html

Thus during the recent switch to asyncpg (commit 18ef939a04f) broke compatibility with sqlite3 before v3.35. The resulting exception was:

sqlite3.OperationalError: near "RETURNING": syntax error

Simply removing the RETURNING (id) suffix of the query fixes the issues for such an older versions of sqlite3. Please note, that the latest stable release of Debian (Bullseye) ships an older version of sqlite3. The same goes for the latest LTS release of Ubuntu. Only the latest short-term supported release of Ubuntu (Impish Indri) contains a newer version (supporting RETURNING).