Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dart3a' into dart3a
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Aug 10, 2023
2 parents 82a9984 + 6b44701 commit 068ff7e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 57 deletions.
3 changes: 3 additions & 0 deletions packages/console_test_app/bin/sqflite_ffi_simple_bin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import 'package:sqflite_common_ffi/sqflite_ffi.dart';
Future<void> main(List<String> arguments) async {
sqfliteFfiInit();
var db = await databaseFactoryFfi.openDatabase(inMemoryDatabasePath);
var sqliteVersion =
(await db.rawQuery('select sqlite_version()')).first.values.first;
print('sqlite version: $sqliteVersion');
await db.setVersion(1);
await db.close();
}
3 changes: 0 additions & 3 deletions packages/console_test_app/lib/console_test_app.dart

This file was deleted.

4 changes: 2 additions & 2 deletions sqflite/doc/opening_asset_db.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if (!exists) {
} catch (_) {}
// Copy from asset
ByteData data = await rootBundle.load(join("assets", "example.db"));
ByteData data = await rootBundle.load(url.join("assets", "example.db"));
List<int> bytes =
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
Expand Down Expand Up @@ -87,7 +87,7 @@ try {
} catch (_) {}
// Copy from asset
ByteData data = await rootBundle.load(join("assets", "example.db"));
ByteData data = await rootBundle.load(url.join("assets", "example.db"));
List<int> bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
await new File(path).writeAsBytes(bytes, flush: true);
Expand Down
2 changes: 1 addition & 1 deletion sqflite/example/lib/exp_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class ExpTestPage extends TestPage {
await deleteDatabase(path);

// Copy from asset
final data = await rootBundle.load(join('assets', 'issue_64.db'));
final data = await rootBundle.load(url.join('assets', 'issue_64.db'));
final bytes =
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
await databaseFactory.writeDatabaseBytes(path, bytes);
Expand Down
4 changes: 2 additions & 2 deletions sqflite/example/lib/open_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class OpenTestPage extends TestPage {
} catch (_) {}

// Copy from asset to a database file.
final data = await rootBundle.load(join('assets', 'example.db'));
final data = await rootBundle.load(url.join('assets', 'example.db'));
final bytes =
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
await databaseFactory.writeDatabaseBytes(path, bytes);
Expand Down Expand Up @@ -642,7 +642,7 @@ class OpenTestPage extends TestPage {
print('Creating new copy from asset');

// Copy from asset
final data = await rootBundle.load(join('assets', 'example.db'));
final data = await rootBundle.load(url.join('assets', 'example.db'));
final bytes =
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
await writeFileAsBytes(path, bytes);
Expand Down
3 changes: 0 additions & 3 deletions sqflite_common_ffi/lib/src/windows/sqlite3_version.md

This file was deleted.

46 changes: 0 additions & 46 deletions sqflite_common_test/lib/exp_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -331,52 +331,6 @@ void run(SqfliteTestContext context) {
await db.close();
});

/*
no bundle support
test('Issue#64', () async {
// await Sqflite.devSetDebugModeOn(true);
var path =await context.initDeleteDb('issue_64.db');
// delete existing if any
await deleteDatabase(path);
// Copy from asset
var data = await rootBundle.load(join('assets', 'issue_64.db'));
var bytes =
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
await new File(path).writeAsBytes(bytes);
// open the database
var db =await factory.openDatabase(path);
var result = await db.query('recordings',
columns: ['id', 'content', 'file', 'speaker', 'reference']);
print('result1: $result');
expect(result.length, 2);
// This one does not work
// to investigate
result = await db.query('recordings',
columns: ['id', 'content', 'file', 'speaker', 'reference'],
where: 'speaker = ?',
whereArgs: [1]);
print('result2: $result');
expect(result.length, 2);
result = await db.query(
'recordings',
columns: ['id', 'content', 'file', 'speaker', 'reference'],
where: 'speaker = 1',
);
print('result3: $result');
expect(result.length, 2);
await db.close();
});
*/

test('sql dump file', () async {
// await Sqflite.devSetDebugModeOn(true);

Expand Down

0 comments on commit 068ff7e

Please sign in to comment.