我正在尝试使用 dataModel 和 persistentStore 创建一个上下文...按照下面的代码使用 PostgreSQL:
@override
Future prepare() async {
logger.onRecord.listen((rec) => print("$rec ${rec.error ?? ""} ${rec.stackTrace ?? ""}"));
final dataModel = ManagedDataModel.fromCurrentMirrorSystem();
final persistentStore = PostgreSQLPersistentStore.fromConnectionInfo(
"heroes_user", "password", "localhost", 5432, "heroes");
context = ManagedContext(dataModel, persistentStore);
}
我想使用 MySQL 而不是 PostgreSQL,我找不到任何使用它的教程。