Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.49k stars 589 forks source link

Error: Error Domain=FMDatabase Code=1. no such index: table__status #1420

Open Stophface opened 1 year ago

Stophface commented 1 year ago

I am getting the following error on a pre-populated database:

Error: Error Domain=FMDatabase Code=1 "no such index: tablestatus" UserInfo={NSLocalizedDescription=no such index: tablestatus}

table is the name if the table. Why do I need an index on each of my tables, on columns watermelonDB relies on? Can anyone explain there this error is coming from?

radex commented 1 year ago

@Stophface Hey, have you figured out your issue here?

Stophface commented 1 year ago

@radex Sadly not. It is a prepoluated database with several tables and I want an index on only a few columns of a few tables. If I create the index in the pre populated database in SQLite like so

CREATE INDEX bar_foo ON bar (foo); 

and use that pre populated database with watermelonDB, it seems like watermelonDB requires and index on all columns of the table...

I "solved" it by not using an index.