Provides an adapter for using the package database with SQLite. The implementation uses the package sqflite.
dependencies:
database: any
database_adapter_sqlite: any
import 'package:database/database.dart';
import 'package:database/sql.dart';
import 'package:database_adapter_sqlite/database_adapter_sqlite.dart';
Future main() async {
final config = SQLite(
path: 'path/to/database.db',
);
final sqlClient = config.database().sqlClient;
final result = await database.querySql('SELECT name FROM employee').toRows();
for (var row in result.rows) {
print('Name: ${row[0]}');
}
}