How to export SQLite data to CSV file in Flutter app
3,088
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);
Author by
Code Hunter
Updated on December 14, 2022Comments
-
Code Hunter over 1 year
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.
-
Haroon khan over 2 yearsdo 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"