sockeqwe / sqlbrite-dao

DAO for SQLBrite
http://hannesdorfmann.com/android/sqlbrite-dao
Apache License 2.0
182 stars 22 forks source link

Wow, a new library! :) #1

Closed konmik closed 8 years ago

konmik commented 9 years ago

I like the library. Just some ideas.

Why returning a mutable state from a background thread? This is not thread-safe and is not safe to pass even in the scope of a single thread. Something created with AutoParcel.Builder is much better.

I would also extract the query builder you have and make another library from it. It is really hard to get one working on Android and they are also not lightweight enough.

sockeqwe commented 9 years ago

Thanks for your feedback!

I'm not sure what exactly you mean with "background thread"? Are you talking about defer()? Then yes, it will definitely be removed ... Immutability is also desired. The library is not a 1.0.0 release yet. Actually many parts of this library are refactored from 2 other libraries and some apps. It need some code clean up and better refactoring and so on. It's just an "initial commit" and still work in progress.

Extra builder library shouldn't be a big deal ... What about this library: https://github.com/nhaarman/SQLiteBuilder

But before I spend more time into this library I wanted to ask the guys over at square if they are working or have plans to come up with a similar layer implementation: https://github.com/square/sqlbrite/issues/32

However, pull requests are welcome ;)

konmik commented 9 years ago

I think that sqlbrite is about background query execution this is where "background thread" came from.

Thanks for the reference :)