mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-09-01 11:24:08 +00:00
89 lines
2.5 KiB
Dart
89 lines
2.5 KiB
Dart
// This file is automatically generated, so please do not edit it.
|
|
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
|
|
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
|
|
|
import '../../database/app.dart';
|
|
import '../../frb_generated.dart';
|
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
|
|
|
class LegacyMigrationReport {
|
|
final PlatformInt64 legacyVersion;
|
|
final List<LegacyTableMigrationCount> tables;
|
|
|
|
const LegacyMigrationReport({
|
|
required this.legacyVersion,
|
|
required this.tables,
|
|
});
|
|
|
|
@override
|
|
int get hashCode => legacyVersion.hashCode ^ tables.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is LegacyMigrationReport &&
|
|
runtimeType == other.runtimeType &&
|
|
legacyVersion == other.legacyVersion &&
|
|
tables == other.tables;
|
|
}
|
|
|
|
class LegacyTableMigrationCount {
|
|
final String table;
|
|
final PlatformInt64 rows;
|
|
|
|
const LegacyTableMigrationCount({
|
|
required this.table,
|
|
required this.rows,
|
|
});
|
|
|
|
@override
|
|
int get hashCode => table.hashCode ^ rows.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is LegacyTableMigrationCount &&
|
|
runtimeType == other.runtimeType &&
|
|
table == other.table &&
|
|
rows == other.rows;
|
|
}
|
|
|
|
class RustAppDatabase {
|
|
const RustAppDatabase();
|
|
|
|
static Future<SqlExecutionResult> execute({
|
|
required String statement,
|
|
required List<SqlValue> arguments,
|
|
}) =>
|
|
RustLib.instance.api.crateBridgeWrapperAppDatabaseRustAppDatabaseExecute(
|
|
statement: statement,
|
|
arguments: arguments,
|
|
);
|
|
|
|
static Future<bool> legacyImportComplete() => RustLib.instance.api
|
|
.crateBridgeWrapperAppDatabaseRustAppDatabaseLegacyImportComplete();
|
|
|
|
/// Imports the non-Signal tables from a Drift v25 database. The import is
|
|
/// transactional and idempotent. Drift must be closed while this runs.
|
|
static Future<LegacyMigrationReport> migrateLegacyDatabase() => RustLib
|
|
.instance
|
|
.api
|
|
.crateBridgeWrapperAppDatabaseRustAppDatabaseMigrateLegacyDatabase();
|
|
|
|
static Future<SqlRows> select({
|
|
required String statement,
|
|
required List<SqlValue> arguments,
|
|
}) => RustLib.instance.api.crateBridgeWrapperAppDatabaseRustAppDatabaseSelect(
|
|
statement: statement,
|
|
arguments: arguments,
|
|
);
|
|
|
|
@override
|
|
int get hashCode => 0;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is RustAppDatabase && runtimeType == other.runtimeType;
|
|
}
|