-
Notifications
You must be signed in to change notification settings - Fork 192
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
Allow query to return objects not entities #130
Comments
Hi @megasoft78! I'm happy to see your interest in the package. To your first request: It's planned to support returning objects for queries that are not entities. #33 holds some more information about this feature request. To your second request: This behavior is also planned. #12 describes the feature. I've seen you forked the repository. Do you plan on implementing the behavior? Would be great to see a PR! |
Hi @vitusortner, |
Hi! the current state of android development pushed me to flutter and yesterday I found your library which seems to perfectly replace room. I would really like to see the @DatabaseView("SELECT collection, artist AS name, group_concat(DISTINCT genre) AS genres, count(*) AS count FROM files GROUP BY artist, collection")
public class Artist {
String collection;
String name;
String genres;
int count;
} I just got into flutter/dart yesterday, so I can't really help in implementing this but I would really like to see some progress here! (I know, this is just a wordy +1, but I really want to motivate it!) |
This adds initial support for @DatabaseView annotations known from room. One test was added, further testing is needed. Implements pinchbv#130.
This adds initial support for @DatabaseView annotations known from room. One test was added, further testing is needed. Implements pinchbv#130.
This adds initial support for @DatabaseView annotations known from room. One test was added, further testing is needed. Implements pinchbv#130. fix linting error
This adds initial support for @DatabaseView annotations known from room. One test was added, further testing is needed. Implements pinchbv#130. fix linting error
This adds initial support for @DatabaseView annotations known from room. One test was added, further testing is needed. Implements pinchbv#130. fix linting error
* Feature: Add support for @DatabaseView annotations This adds initial support for @DatabaseView annotations known from room. One test was added, further testing is needed. Implements #130. fix linting error * Clean up Uint8List/Blob<->View interop * Add unit tests * Add integration tests for view * Fix issues from review - Do not allow queries from views to be streamed - throw error if a user tries to do that and test that error - remove Stream<> queries from DAO in integration test - getStreamEntities will only return entities again - Create new Superclass for EntityProcessor and ViewProcessor named QueryableProcessor to deduplicate common functions - Code cleanup - clean up integration tests - improve code layout and comment wording in annotations, DatabaseProcessor, QueryMethodProcessor - fix toString and hashCode methods in Database (value object) - improve error message wording in DatabaseViewError * Adapt to upstream changes,split integrations tests * Fix from review part 2 (tests & documentation) - Clean up small details in code, according to the review - Improve tests - Simplify integration tests - split off and merge common QueryableProcessor tests into a separate file - move createClassElement function, which is now used in three test files to testutils - Add documentation to README.md
I think this can be closed now, as 90% of the DatabaseView features are implemented and the remaining 10% (Streams on Views) open a whole new can of worms :) |
I'm closing this as this seems to be adressed now, with Streams of DatabaseView queries also coming soon. |
The general issue (parsing the results of arbitrary queries into objects) is tracked in #94 |
Hi, I have a question. Am not totally sound on this but need assistance. I have entities [A, B] created and would like to know how to implement a Join by id from B (child) to A (parent), where both hold a list of items. |
You could create a database view which has the join as the query and its result columbs as fields. You can then make a query on that view to return the results of that join. |
do yo have full example for left join |
Hi,
I'm using your amazing package for my first app on Flutter and I'm having an issue.
I want to query the data and return the result of these queries into some objects that are not table.
For instance if I want to have the result of a group by query like this one:
I need the possibility to setup a class like this:
I replaced the @entity with @view as alternative to describe this type of entity.
I also find sometime that I need the possibility to define field that are not column of the table but just calculated field.
Here's an example:
I can try to help by looking at the code and try to adapt it but I'm not sure I have enough experience to make it right.
I hope you can help on this. :)
The text was updated successfully, but these errors were encountered: