Ent: Feature request: specify fields to select

Created on 8 Feb 2020  路  3Comments  路  Source: ent/ent

We can limit field set we are selecting from database to allow optimizations (e.g. index-only SELECT)

Also would be interesting to integrate this with graphql later.
Not sure about API tho, let's discuss?

Most helpful comment

We can limit field set we are selecting from database to allow optimizations (e.g. index-only SELECT)

Also would be interesting to integrate this with graphql later.

There is an option for query specific fields, but it's not good enough as we wanted it to be:

names, err := client.Pet.
    Query().
    Select(pet.FieldName).
    Strings(ctx)

We already started to work on GraphQL integration, and we plan to tackle this issue as well. I hope to OSS some of it in the near future (in a separate repo).

If you think there are additional stuff to discuss here, keep the issue open. Otherwise, let鈥檚 close it.

All 3 comments

We can limit field set we are selecting from database to allow optimizations (e.g. index-only SELECT)

Also would be interesting to integrate this with graphql later.

There is an option for query specific fields, but it's not good enough as we wanted it to be:

names, err := client.Pet.
    Query().
    Select(pet.FieldName).
    Strings(ctx)

We already started to work on GraphQL integration, and we plan to tackle this issue as well. I hope to OSS some of it in the near future (in a separate repo).

If you think there are additional stuff to discuss here, keep the issue open. Otherwise, let鈥檚 close it.

Great, thank you! Let's close it for now.

@a8m is this integrated with entgql?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BitPhinix picture BitPhinix  路  5Comments

jbub picture jbub  路  5Comments

dilipkk-foyernet picture dilipkk-foyernet  路  4Comments

a8m picture a8m  路  5Comments

francismarcus picture francismarcus  路  3Comments