Questions tagged [flutter-moor]

Moor is an easy to use, reactive persistence library for Flutter apps. It allows to define tables in Dart or SQL and provides a fluent query API, auto-updating streams and more.

96 questions
9
votes
5 answers

How to count records in sqlite db table using moor_flutter package?

How do I count all rows in a table and get number of rows as a result using the moor_flutter package? I have seen moor_flutter official documentation here but I can't find what I'm looking for. I was hoping it would be like the function below…
James Mwase
  • 828
  • 1
  • 16
  • 29
8
votes
3 answers

Flutter moor: missing libsqlite3.so

I'm writing a simple Flutter app with Moor; I have created the table, database and dao, but when I launch the app it crashes with an error that the libsqlite3.so library can't be found. This is my database import 'dart:async'; import…
Francesc
  • 25,014
  • 10
  • 66
  • 84
8
votes
6 answers

Flutter : Difference between Moor and floor ORMs

So I had been looking for some ORMs for Flutter and I found two candidates Moor and Floor. Seems like Moor has a little bit more active repository but As I came from the Android world, Floor seems more similar to Room which I used to…
erluxman
  • 18,155
  • 20
  • 92
  • 126
7
votes
1 answer

How To Create Flutter Moor Relationship With One-To-Many Join

I have a table Category which is Related to a Task table in a one-to-many relationship and I am attempting to perform a join using Moor. I would like to return a list for the list of tasks that match a category. How do I do it? …
6
votes
4 answers

Flutter StreamProvider not pushing data into UI

I'm new to flutter. I implemented this sample application to get an idea about SQLite and provider state management. This is a simple task management system. I used MOOR to handle the SQLite database. The problem I'm having is tasks list is not…
6
votes
2 answers

flutter moor - update only specified columns without custom query

I want to update only specified columns, when I execute update(table).replace(model) it replaces all data corresponding to primary key. How to update only specified column without writing custom queries.
Ashique bzq
  • 541
  • 2
  • 9
  • 21
5
votes
1 answer

The parameter 'id' is required. when id is Autoincrement

When I try to create a data object to save in my database, it is giving me a warning saying that the id is required. However, the is should be automatically created by moor when added to the database, as it is marked as autoincrement. My table code…
Nailuj29
  • 750
  • 1
  • 10
  • 28
4
votes
2 answers

Row too big to fit into CursorWindow requiredPos=0, totalRows=1;

I keep hitting this annoying message ! When data finished insert into local database, I saw this message JNI critical lock held for 30.083ms on Thread[27,tid=23883,Runnable,Thread*=0xce150a00,peer=0x12cc0190,"Sqflite"] If I select data from the…
John Joe
  • 12,412
  • 16
  • 70
  • 135
4
votes
1 answer

Flutter-moor generator problem with build-runner

Whenever I try to run flutter packages pub run build_runner watch I get this error message in the Terminal Failed to precompile…
Ahmed Elshorbagy
  • 591
  • 5
  • 21
4
votes
0 answers

Flutter injectible only factory methods can have parameters

So I'm trying to use moor to create an encrypted database, and use Injectible/GetIt to be able to inject it into other classes. I have a wrapper class @Singleton.lazy(signalsReady: true) class BillingDatabaseModule { static BillingDatabase…
Cate Daniel
  • 724
  • 2
  • 14
  • 30
3
votes
1 answer

How to stop class database file getting created multiple times when using flutter_moor?

Whenever I am adding a new row to my database in my flutter app, I am getting this error : WARNING (moor): It looks like you've created the database classAppDatabase multiple times. When these two databases use the same QueryExecutor, race…
Het Naik
  • 53
  • 5
3
votes
1 answer

Flutter, Moor and WorkManager

I am developing a flutter application (at the time just for Android, but with iOS support planned for later). The application operates in two ways: Flutter UI with most of the business logic (Foreground isolate, started with the main method)…
Martin Hlavňa
  • 648
  • 7
  • 20
3
votes
2 answers

Adding distinct to a flutter moor query

I have the following flutter moor query (select(recipeGarnishes)..where((tbl) => tbl.postGarnish.equals(true))).get(); How would I add the distinct condition to the query? Update: The query I want to write is: select DISTINCT garnishName from…
DrkStr
  • 1,752
  • 5
  • 38
  • 90
3
votes
2 answers

Flutter Moor join and where

My Dependencies for moor: moor_flutter: ^2.1.1 moor_ffi: ^0.4.0 I have the tables: netPoint = Information about the netPoint netPointNetPoint = linking of netpoints I want all netPoints that match the "PARENTS_ID" s. below. My problem is that…
osion
  • 93
  • 2
  • 14
3
votes
1 answer

How to create a Column for double Values in flutter moor

I using flutter_moor for the SQLite Database. I have the issue that I need a column for a currency amount in double with two decimal places. I find out that there is a RealColumn, but don't find out how to implement it correct. /// A column that…
SpiriDs
  • 33
  • 1
  • 4
1
2 3 4 5 6 7