I am trying to achieve export to CSV from SQLite data of my Flutter app. I want to know an efficient way to achieve this.
1 Answer
You can use https://github.com/tekartik/sqflite_more/tree/master/sqflite_porter
alextekartik comments in https://github.com/tekartik/sqflite/issues/78
csv utils detail code https://github.com/tekartik/sqflite_more/blob/master/sqflite_porter/lib/utils/csv_utils.dart
var result = await db.query('MyTable');
var csv = mapListToCsv(result);
1 Comment
Haroon khan
do you know a proper way of using sqflite_porter to export db to sql statements but I'm getting issues like below: No such table: sqlite_sequence in "SELECT * from sqlite_sequence"