2

My main goal is to import a database into a flutter app using sqlite(sqlflite plugin), instead of having to hard code all of the create tables into the apps code.

*I want the information to be accessed to the phone locally(access data from phone on airplane mode) that is why i am using sqlite

I am having trouble finding information on this online and was seeing if anyone had experience in doing this or has documentation/examples that could help.

2 Answers 2

1

i think you are looking for this : Open an asset database in this case you must have the database already and you don't need to create tables

Sign up to request clarification or add additional context in comments.

7 Comments

I am having trouble quite understanding that, it seems this would be a fix for something that i wouldn't have to otherwise write myself, i do have a mysql database with everything written in it, but for the purposes of this app i need the database to connect to sqlite to persist the specific data i need from the database to the app. Im starting to think that may not be possible.
you have a mysql and you want to import it to SQLITE ?
Yeah i do, i realize that i need to hardcode no matter what, unless i'm connecting remotely to a database which i don't want to do. Just need data to persist on the app permanently
take a look at other choice like Firebase firestore or Realm you get this behaviour for free
Perfect, looks like they have offline persistence, thank you!
|
0

Flutter supports an open source module SQFlite. SQFlite is a way of storing app data in Flutter Application. SQFlite is a Database plugin for flutter. It is highly reliable and embedded Database engine. All the CRUD operation in the database will run on a background thread. You can see a simple example of this here.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.