Sqlite.getAll requires that you have enough memory to store the entire result set in memory. This isn't always possible, so we should introduce a new function that can reduce a large result set into a smaller value.
Sqlite.fold would work exactly like Array.foldl, and would be based on the Node.js sqlite.iterate function: https://nodejs.org/docs/latest-v22.x/api/sqlite.html#statementiteratenamedparameters-anonymousparameters
Sqlite.getAllrequires that you have enough memory to store the entire result set in memory. This isn't always possible, so we should introduce a new function that can reduce a large result set into a smaller value.Sqlite.foldwould work exactly likeArray.foldl, and would be based on the Node.jssqlite.iteratefunction: https://nodejs.org/docs/latest-v22.x/api/sqlite.html#statementiteratenamedparameters-anonymousparameters