Parent
Part of #414
Problem
SqliteSqlWorkspace calls conn.execute → rawQuery, which materializes all matching rows, then applies _resultMaxRows with .take(cap).
Unlike Postgres (injectSqlLimit), SQLite has no server-side LIMIT injection. Caps can be up to 100 000 rows (AppSettings), so peak memory is O(full result), not O(cap).
Evidence
lib/features/sqlite/sqlite_sql_workspace.dart (~159–179)
lib/core/database/sqlite_connection.dart (execute / rawQuery)
Related
Follow-up to partially closed #184 (Postgres/MySQL); SQLite was never covered.
Acceptance
Suggested fix
Inject LIMIT when safe (mirror injectSqlLimit), or use a streaming/cursor API and stop after cap rows.
Parent
Part of #414
Problem
SqliteSqlWorkspacecallsconn.execute→rawQuery, which materializes all matching rows, then applies_resultMaxRowswith.take(cap).Unlike Postgres (
injectSqlLimit), SQLite has no server-side LIMIT injection. Caps can be up to 100 000 rows (AppSettings), so peak memory is O(full result), not O(cap).Evidence
lib/features/sqlite/sqlite_sql_workspace.dart(~159–179)lib/core/database/sqlite_connection.dart(execute/rawQuery)Related
Follow-up to partially closed #184 (Postgres/MySQL); SQLite was never covered.
Acceptance
LIMIT(or equivalent cursor) before materializing into aListcaprows into Dart memorySuggested fix
Inject
LIMITwhen safe (mirrorinjectSqlLimit), or use a streaming/cursor API and stop aftercaprows.