cmelchior / realmfieldnameshelper

Realm extension library used to create more type-safe queries.
Apache License 2.0
173 stars 21 forks source link

Set depth of fields generation #20

Open lukcz opened 7 years ago

lukcz commented 7 years ago

Is it possible to set custom depth of generated fields?

AnixPasBesoin commented 7 years ago

Have you checked this issue? @cmelchior will have to correct me in case I'm wrong, but as far as I know, setting a custom depth is not supported by design. Quoting the above issue:

... Another alternative would be to provide some form of configuration option for it, but I would prefer to keep this lib as no-config as possible.

Check the pull request that added support links for fields to get more insight.

mgohin commented 6 years ago

I'm in a case where I need to request like query.equalTo('x.y.z', myValue)

A depth more than 1 would be nice ;)

antoncyrol commented 4 years ago

Instead of setting an explicit depth (which is not favored by @cmelchior, see comment on #4 as it would introduce options to the library), one could just generate the fields indefinitely, i.e. until there is no further reference or a cyclic reference would be created. For the latter one just would have to check if the field to be referenced is already present in the chain of references.

antoncyrol commented 4 years ago

Frankly, I don't see how this code (edit: no longer visible) does its magic @AnixPasBesoin, because e.g. FooFileds.BAR.ID yields "id" where it would have to be "bar.id".

AnixPasBesoin commented 4 years ago

Now I feel ashamed haha! Yup, you're complety right, this doesn't solve anything!