Open Gorniv opened 5 years ago
@Gorniv Why use hive instead of SQLite?
@petermichaux because its much faster than sqlite.
cache manager uses SQLite only like key-value storage, but hive faster! And I have crashed at the android device with SQLite error.
also i think hive have a simple api than sqlite. so it would be easy to implement.
same problem here, sqlite causes this problem Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
hivedb support web!
hivedb work in web. Read docs of hivedb
hivedb work in web. Read docs of hivedb
I know, read my message again.
sorry, I think you write about hive)
If someone is interested in adding support, they would need to implement the CacheInfoRepository interface: https://github.com/Baseflow/flutter_cache_manager/blob/ed5a205bcb5e816d05113c0360fea02aadc7e2be/flutter_cache_manager/lib/src/storage/cache_info_repository.dart
This one works well for me:
any update?
I don't think this is a Hive vs sqflite debate. flutter_cache_manager
is a library, and it should have flexibility depending on what the developer needs to use in the rest of the project. The worst case is to dictate sqflite or hive when the developer is using the other one, and that means pulling in two dependencies, increases compile time, increases app size, increases app loading time, increases memory jank, increases garbage collection interruption, giving a worse user experience.
We don't want that. We want to have the flexibility, which is why interface pattern is so cherished by developers. We do have the cache_info_repository.dart like an interface, maybe this file should be pulled into a separate Dart package on its own, and refactor flutter_cache_manager
into a sqflite implementation. This allows someone to make the Hive implementation. Then we are all good to choose whichever dependency we like.
hivedb work in web. Read docs of hivedb
why not drift
Use hive(https://github.com/hivedb/hive) instead SQLite.