Hi, I've recently switched to using the experimental WasmDatabase implementation for easy cross platform support. Everything works as expected on windows but on chrome (and firefox) I get this error after issuing a select statement.
Uncaught Error: SqliteException(11): database disk image is malformed, database disk image is malformed (code 11)
Causing statement: SELECT * FROM market_orders_cache;
I use this code to add approximately 160,000 rows to the table
Future<void> setOrders(Map<int, List<Order>> allOrders) async {
await _clearCache(cache.marketOrdersCache);
final inserts = <MarketOrdersCacheCompanion>[];
allOrders.forEach((_, orders) {
inserts.addAll(orders.map((o) => MarketOrdersCacheCompanion.insert(
typeID: o.typeID,
systemID: o.systemID,
regionID: o.regionID,
isBuy: o.isBuy,
price: o.price,
volumeRemaining: o.volumeRemaining,
)));
});
await cache.batch((batch) {
batch.insertAll(cache.marketOrdersCache, inserts);
});
}
Later I use a basic select statement which causes the error.
final rows = await cache.select(cache.marketOrdersCache).get();
Here is my project for reference if needed.
The issue occurs on the latest drift and flutter master channel versions.
Hi, I've recently switched to using the experimental WasmDatabase implementation for easy cross platform support. Everything works as expected on windows but on chrome (and firefox) I get this error after issuing a select statement.
I use this code to add approximately 160,000 rows to the table
Later I use a basic select statement which causes the error.
Here is my project for reference if needed.
The issue occurs on the latest drift and flutter master channel versions.