Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(0.4.0) queryList - the parameter 'mapper' is required #125

Closed
abhinavc opened this issue Apr 26, 2019 · 2 comments
Closed

(0.4.0) queryList - the parameter 'mapper' is required #125

abhinavc opened this issue Apr 26, 2019 · 2 comments

Comments

@abhinavc
Copy link

Hi,
Not sure if this is related to #113. But I have a simple DAO with the following query

@Query("select * from sports")
Future<List<Sport>> getAll() ;

However, I get the following compilation error

lib/db/db.g.dart:70:35: Error: Too many positional arguments: 1 allowed, but 2 found.
Try removing the extra positional arguments.
    return _queryAdapter.queryList('select * from sports', _sportsMapper);

in the generated .part file

@override
  Future<List<Sport>> getAll() async {
    return _queryAdapter.queryList('select * from sports', _sportsMapper);
  }

This started happening when I upgraded from 0.3.0 to 0.4.0. And I was upgrading because the code for inserting List into the DB did not seem to be working in 0.3.0

@abhinavc
Copy link
Author

My bad. I forgot to change the floor_generator: 0.4.0 dependency in pubspec.yaml

But I still can't seem to insert records properly. For example, the following seems to work
Future<void> insertAll(List<Sport>)

But when I try to retrieve the just-added records using
Future<List<Sport>> getAll()

all that I get is a list of records with every field null. Can't understand why

@abhinavc
Copy link
Author

Problem was at my end - in the default constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant