pinchbv / floor

The typesafe, reactive, and lightweight SQLite abstraction for your Flutter applications
https://pinchbv.github.io/floor/
Apache License 2.0
947 stars 190 forks source link

No stream updates with quoted table name #833

Open marek-dabek opened 3 months ago

marek-dabek commented 3 months ago

Background

Since some of my column/table names conflict with SQLite's list of reserved keywords I just started quoting every identifier. That causes all my streams to silently fail.

Example

  @Query('SELECT * FROM "table_name"')
  Stream<List<Data>> listAll();

Expected behavior

Stream event published when whenever rows are modified.

Actual behavior

Stream event is not published whenever table rows are modified.

Cause

After lots of debugging I found the culprit. It's the code that parses the SQL query to extract the table names used.

Possible solutions

  1. Fix the parser Regexp to include "quoted_table_names"
  2. Allow users to manually pass the list of tables used in the query