我目前正在构建一个 Flutter 应用程序,其中包含更大的数据集(例如 2000-10000 条文本)。 我对 Flutter 开发还比较陌生,所以我不知道什么数据库最适合这种情况。
该应用程序不需要连接到互联网,下载后所有数据都在设备上。 您只需要广泛查询这些数据并从中构建数据集即可。
我研究了一下,但最常用的数据库(hive)似乎不适合我的需求。
如果有人能提供帮助,我将不胜感激。
最佳答案
看来 ObjectBox 最适合大数据,它的性能非常好
[Check this package best suits for your data][1]
import 'package:objectbox/objectbox.dart';
class Note {
// Each "Entity" needs a unique integer ID property.
// Add `@Id()` annotation if its name isn't "id" (case insensitive).
int id = 0;
String? text;
DateTime date;
@Transient() // Make this field ignored, not stored in the database.
int? notPersisted;
// An empty default constructor is needed but you can use optional args.
Note({this.text, DateTime? date}) : date = date ?? DateTime.now();
// Note: just for logs in the examples below(), not needed by ObjectBox.
toString() => 'Note{id: $id, text: $text}';
}```
关于database - 如何在 Flutter 应用程序中最好地在本地存储和操作大型数据集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62556998/