2

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 1

6

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);
Sign up to request clarification or add additional context in comments.

1 Comment

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"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.