Questions tagged [sqflite]

Use this tag for questions about the plugin for flutter named sqflite - which enables storage, retrieval, and manipulation of SQLite databases via flutter code.

sqflite is an plugin for . Supports both and .

Package documentation: sqflite

902 questions
3
votes
1 answer

Problem inserting into sqflite using Flutter

I´m having problems with sqflite in Flutter. Normal inserts work just fine... but as soon as I insert a value, which is the id I get from inserting int into the first table, I get a syntax error near ")". This is the error I get: flutter: error…
juicy
  • 126
  • 8
3
votes
0 answers

Storing complex objects in Flutter using sqflite package

I'm developing a mobile application that needs to store locally on user's device some information about the places he visited. These are my model classes: class Place extends Equatable { final String placeId; final double latitude; final…
Marco Gelli
  • 319
  • 2
  • 15
3
votes
1 answer

How do I list the table names in a SQFlite Database in Flutter?

I have tried the following and only received information on the entire database. listTables() async { sqflite.Database dbClient = await this.db; List> tables = await dbClient .query('sqlite_master'); …
S Galway
  • 125
  • 2
  • 11
3
votes
0 answers

Fetching data from sqflite and sending it to firebase

I made a local database using sqflite to save data locally and i need to send it to a firebase in need so far the function i used to get the data is: Future getNameAndPrice() async{ Database db = await instance.database; var result =…
Idris
  • 43
  • 5
3
votes
1 answer

SQLite DB file remains after uninstalling the app

I have a flutter app where I use a sqflite DB storage. I create a DB as pointed in the sqflite example - I use getDatabasesPath() as a relative path to the app and then var db = await openDatabase(path_to_db_file);. Everything works fine, I can…
3
votes
0 answers

Flutter saving sqflite database to downloads directory

The scenario is that the user needs to be able to save/backup their data. So that they can restore their data if ever needed in the future. Or even transfer data from one phone to another. Users data is stored in a sqflite database. I want to…
Michael Johnston
  • 718
  • 2
  • 11
  • 25
3
votes
2 answers

sqflite IN operator with AND operator

I have following query which select from employee table where name is "max" and ID not in 123 and 444. Not in IDs can grow in future. But I am receiving error as Error ( 8023): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception:…
max
  • 1,505
  • 3
  • 15
  • 38
3
votes
1 answer

Is there any way to check Sqflite Database tables in flutter using Device File Explorer in Android Studio?

I am creating database in Flutter using Sqflite my database is created successfully and tables also I can print data on command line but I want to know how can I see all the tables using database file like Native Android ?
user11848379
3
votes
1 answer

Error when populating FutureBuilder with data from sqflite

I have an SQLite database with movies. I'm following this example. I want to show all the movies in a ListView. I try to populate the ListView using a FutureBuilder like in the example, but where I assign the future of the FutureBuilder, it throws…
Zebrastian
  • 421
  • 2
  • 7
  • 18
3
votes
1 answer

Is there any example of pre-populated database usage in Flutter?

Is there any example of pre-populated database usage in Flutter? I don't need CRUD example. At this point I just need to read data from database. I am new to Flutter so step by step tutorial would be nice.
3
votes
3 answers

How to fix "flutter: DatabaseException(open_failed...)"?

I'm trying to run my flutter app on my iPhone 7 but I'm receiving an error message. Running the app on my Android phone as well as on the iPhone XR simulator works fine. I also tried to test the app on my iPad and I got the exact same error message…
3
votes
1 answer

Flutter create listview with local sqlite file

Create a listview from a local sql file(chinook.db) using sqflite Initial issue solved: I/flutter ( 5084): Instance of 'Future' Reference code: https://github.com/tekartik/sqflite/blob/master/sqflite/doc/opening_asset_db.md Thanks @aakash for the…
Scott Summers
  • 75
  • 2
  • 5
3
votes
1 answer

Flutter SQLite no such column

I am developing a Flutter app that uses SQLite database using Flutter SQFlite plugin. Issue is that when I try to insert some test data, app prints following in the console: Unhandled Exception: DatabaseException(no such column: dummy_value (code…
Muhammad Faizan
  • 1,891
  • 2
  • 18
  • 37
3
votes
1 answer

Unable to read sql file from assets in flutter

I'm trying to load prepopulated data into my flutter application. I've created 'assets' folder in the root of my project & put 'mydb.sql' file into that folder. Added that file reference in pubspec.yaml assets: - assets/mydb.sql Below is my code…
akshay bhange
  • 2,320
  • 2
  • 28
  • 46
3
votes
2 answers

OnUpgrade SQFLITE: Unhandled Exception: DatabaseException(table UsernameTable has no column named rememberMe (Sqlite code 1):

Unhandled Exception: DatabaseException(table UsernameTable has no column named rememberMe (Sqlite code 1): , while compiling: INSERT OR REPLACE INTO UsernameTable (username, rememberMe) VALUES (?, ?), (OS error - 2:No such file or…
BIS Tech
  • 17,000
  • 12
  • 99
  • 148