database - 如何在 Flutter 应用程序中最好地在本地存储和操作大型数据集

标签 database flutter hive

我目前正在构建一个 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/

相关文章:

MySQL 分组依据与时间差异

mysql - 数据库设计,如何减少不同列的数据冗余

sql - 在 Hive 中创建具有当前时间戳(以纳秒为单位)的新列

hadoop - Cloudera Hive : FAILED: Execution Error, 从 org.apache.hadoop.hive.ql.exec.mr.MapRedTask MapReduce 返回代码 2

hadoop - Oozie从文件获取变量

java - 无法在数据库android中插入

database - Elasticsearch对整数字段的最大约束?

flutter - Flutter Hive:按日期分组

flutter - 在 flutter 中设置开关按钮的图像

layout - 在Flutter中,如何使用FittedBox调整行内文本的大小?