drydart / flutter_sqlcipher

SQLCipher database plugin for Flutter apps.
https://pub.dev/packages/flutter_sqlcipher
The Unlicense
66 stars 14 forks source link

Query without "limit" #4

Closed develhox closed 5 years ago

develhox commented 5 years ago

Library version: 0.4.2

Actions to reproduce the bug

Call the SQLiteDatabase.query() method without a limit clause. For example: SQLiteDatabase.openOrCreateDatabase(path).query(table: tableName)

Expected behaviour

The method returns a cursor with all the rows in the table

Bugged behaviour

The library produces an incorrect SQL query and throws the following exception: java.lang.IllegalArgumentException: invalid LIMIT clauses:null

Suggested fix

I took a look at the code and I found that the issue is at the line 432 of database.dart. To fix it the line 'limit': limit.toString(), should be replaced with 'limit': limit?.toString(),

artob commented 5 years ago

Thanks! I've released 0.4.3 which includes this fix.