sqflite (Flutter Package of the Week)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
♪ [music] ♪ Sometimes, your app needs to save important data on the device. If it's structured data, chances are you want to use a SQL database. A SQL database engine that is available on almost any device, including mobile phones, is called SQLite. It's small and self-contained. It uses a single file to store your tables, and the code is public domain. Flutter developers have a variety of options for using SQLite. One of the most popular plugins is sqflite. In sqflite, you open a database file by calling <i>openDatabase</i>. Almost everything in sqflite is asynchronous, so you'll have to <i>await</i>. You can also provide callbacks that create the database if it doesn't exist yet or upgrade the database if it's using an old schema. Sqflite lets you execute raw SQL on the database. And it helps you with escaping values, so you don't accidentally corrupt your database. You can also use higher-level functions-- <i>insert</i>, <i>update</i>, <i>delete</i>-- to modify your database and <i>query</i> to get data out of it. Sqflite also supports transactions and batching so your database operations can be safer and more efficient. Lastly, a couple of tips from the community. It's best to design your database and test your queries on your development machine, and only then, copy your SQL to your project. If you use foreign keys, you can enable them in <i>onConfigure</i> when opening the database. Foreign keys are not on by default. Don't forget that sqflite is not your only local database option. Research <i>pub.dev</i> to see if there's a local database plugin that fits your needs better. For more details and instructions on including this functionality in your app, check out the sqflite package on <i>pub.dev</i>.
Info
Channel: Flutter
Views: 124,976
Rating: undefined out of 5
Keywords: GDS: Yes, sqflite, sqlite, SQL database, SQL database engine, SQLite, mobile, iOS, Android, web, macOS, build an app, app building, coding, coding an app, Flutter, storing data, widget of the week, google, google developers, flutter 101, get started with flutter, flutter apps, tech, new in tech, flutter widgets, flutter developers, developers, build apps with flutter, Package of the Week
Id: HefHf5B1YM0
Channel Id: undefined
Length: 1min 56sec (116 seconds)
Published: Thu Oct 08 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.