mqus

Results 99 comments of mqus

Floor actually only uses the constructor and not setters(iirc) so this is a reasonable request imho.

We currently don't have an API method for that. But since we also just piggyback on sqflite, you can use those methods just fine. I haven't tested the following example...

Why not assign a default value in the class description by changing > ```dart > @ColumnInfo(name: "IsActive", defaultValue: "false") > bool active; > ``` to ```dart @ColumnInfo(name: "IsActive") bool active=false;...

Sorry, you had no `final`s in your example code, so I assumed otherwise :wink: What about ```dart @ColumnInfo(name: "IsActive") final bool active; YourClass(this.id, this.foo, {this.bar, this.active=false}); ``` ? here, `bar`...

Tbh, If I would implement this, I would probably do it in the same manner as [room had done it](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-master-dev:room/common/src/main/java/androidx/room/ColumnInfo.java;l=86;drc=4f917f20e63afc653a6092ad87cfbb10bcc1552c), Meaning that the generated `CREATE` query for the entity would...

As I wrote before, building a `CREATE TABLE` statement which sets the default with literal values or expressions (like you wrote) is very easy. But selectively omitting fields when creating...

Thank you for your effort! you might want to open a PR if you would like to see this in floor. Implementation-wise, I personally think it would be better to...

Sadly we don't allow completely dynamic queries like yours. Your use-case might be an exception but generally this is also not a good idea because of sql-injections and other issues....

Ah right, one more thing: - Is there a reason why the transaction currently only returns void? Afaict it should be able to return anything (wrapped inside a Future, obviously).

> Ah right, one more thing: > > * Is there a reason why the transaction currently only returns void? Afaict it should be able to return anything (wrapped inside...