litestream sqlite

Litestream v0.3.13 and JSON Aggregate Ordering

Marcelino Veloso III,

When running litestream replicate on a database that contains views using order by inside a json_group_array call, the following error is raised:

time=xxx level=ERROR msg="sync error" db=test.db error="malformed database schema (view_future_statute_units) - near "order": syntax error"

The same issue occurs when running litestream restore:

time=xxx level=ERROR msg="cannot apply wal: malformed database schema (view_future_statute_units) - near "order": syntax error"

Since order by within aggregate JSON functions is valid SQLite syntax starting with version 3.38, this suggests that the SQLite library bundled with Litestream v0.3.13 is older than the required version.