jadb/bin/ja_db.dart

21 lines
570 B
Dart

import 'dart:ffi';
import 'dart:io';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
import 'package:sqlite3/open.dart';
import 'jmdict/parser.dart';
import 'kanjidic/parser.dart';
import 'radkfile/parser.dart';
Future<void> main(List<String> arguments) async {
final db = await createDatabaseFactoryFfi(ffiInit: () {
open.overrideForAll(() => DynamicLibrary.open(arguments[0]));
})
.openDatabase(Directory.current.uri.resolve('jadb.sqlite').path);
await addDataFromJMdict(db);
await addDataFromRADKFILE(db);
await addDataFromKANJIDIC(db);
}