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

There is support for query only entity id from table? #528

Closed
pskital opened this issue Apr 6, 2021 · 1 comment
Closed

There is support for query only entity id from table? #528

pskital opened this issue Apr 6, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@pskital
Copy link

pskital commented Apr 6, 2021

I want to query only ids from specified table like this:

@Query('SELECT id FROM messages_entity')
Future<List<int>> getMessagesIds();

but generated code return:

@override
Future<List<int>> getMessagesIds() async {
  await _queryAdapter.queryNoReturn('SELECT id FROM messages_entity');
}
@mqus
Copy link
Collaborator

mqus commented Apr 23, 2021

There is currently no direct support for that. You could try to create a virtual table only containing the IDs via a View. Returning anything else other than void, entities or views from a query is currently not supported and support is tracked in #200.

I'll close this as a duplicate. Just reopen if you disagree or if I misunderstood your issue :)

@mqus mqus closed this as completed Apr 23, 2021
@mqus mqus added the duplicate This issue or pull request already exists label Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Development

No branches or pull requests

2 participants