SQLite in Flutter
Prepared By: Nabin Dhakal
What is SQLite?
● SQLite is a software library that provides a relational database management
system. The lite in SQLite means lightweight in terms of setup, database
administration, and required resources.
● SQLite has the following noticeable features: self-contained, serverless, zero-
configuration, transactional.
● It is not a standalone app; rather, it is a library that software developers
embed in their apps.
For Flutter: We use this sqflite package to perform SQL queries.
How Server Database works
SQLite Working
Opening a database
A SQLite database is saved in the path obtained by getDatabasesPath(). Path
from getDatabasesPath() is the default database Android and the documents
directory on iOS/MacOS.
Creating Table
Close database
Many applications use one database and would never need to close it (it will be
closed when the application is terminated).
If you want to release resources, you can close the database.
Add Item
Read Item
Edit/Update
Delete
Supported SQLite types
● INTEGER
● REAL
● TEXT
● BLOB
Unsupported types
● DateTime
○ Can store them with int (millisSinceEpoch) or string (iso8601).
● bool is not a supported SQLite type.
○ Use INTEGER and 0 and 1 values.
Thank You!!!

SQLite in Flutter.pptx

  • 1.
  • 2.
    What is SQLite? ●SQLite is a software library that provides a relational database management system. The lite in SQLite means lightweight in terms of setup, database administration, and required resources. ● SQLite has the following noticeable features: self-contained, serverless, zero- configuration, transactional. ● It is not a standalone app; rather, it is a library that software developers embed in their apps. For Flutter: We use this sqflite package to perform SQL queries.
  • 3.
  • 4.
  • 5.
    Opening a database ASQLite database is saved in the path obtained by getDatabasesPath(). Path from getDatabasesPath() is the default database Android and the documents directory on iOS/MacOS.
  • 6.
  • 7.
    Close database Many applicationsuse one database and would never need to close it (it will be closed when the application is terminated). If you want to release resources, you can close the database.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
    Supported SQLite types ●INTEGER ● REAL ● TEXT ● BLOB
  • 13.
    Unsupported types ● DateTime ○Can store them with int (millisSinceEpoch) or string (iso8601). ● bool is not a supported SQLite type. ○ Use INTEGER and 0 and 1 values.
  • 14.