Giter VIP home page Giter VIP logo

Comments (11)

mrakolice avatar mrakolice commented on August 21, 2024

Also, I don't see any opportunities to extend this library on my side, and this makes me very sad. (( Can I refactor it and make customization much easier (I think so, at least =) )?

from orm.

wolfy-j avatar wolfy-j commented on August 21, 2024

Hi, I will be able to respond in more details after new year eve holidays (our company is off this time). Getting model with partial fields can open a lot of issues in your business logic so we left columns() not reachable intentionally. But, have you checked embedded models? They can be lazy loaded which essentially can be used as safe way to achieve partial loading.

from orm.

wolfy-j avatar wolfy-j commented on August 21, 2024

https://cycle-orm.dev/docs/relation-embedded#eager-and-lazy-loading

from orm.

mrakolice avatar mrakolice commented on August 21, 2024

Unfortunately, embedded entities is not that I want to. ((

In my company we try to build JSON API request parser (like in jsonapi.org) and we need to dynamically choose field getting from database (fields=field1,field2&fields[related_entity]=field2) for some issues in our business logic.

from orm.

wolfy-j avatar wolfy-j commented on August 21, 2024

Hmmm; I don’t think such approach lays down well with ORMs but we can make this https://github.com/cycle/orm/blob/master/src/Select/RootLoader.php#L156 to be customizable.

from orm.

wolfy-j avatar wolfy-j commented on August 21, 2024

You can also init ORM with custom column schema.

from orm.

mrakolice avatar mrakolice commented on August 21, 2024

Hmmm; I don’t think such approach lays down well with ORMs but we can make this https://github.com/cycle/orm/blob/master/src/Select/RootLoader.php#L156 to be customizable.

This is would be great!

from orm.

mrakolice avatar mrakolice commented on August 21, 2024

You can also init ORM with custom column schema.

So, I just can redefine schema, than do some query stuff and after fetchAll() can work with whole entity tree?

from orm.

wolfy-j avatar wolfy-j commented on August 21, 2024

Correct. You can basically create new ORM instance with specific set of columns, that’s what dynamic schema is doing.

from orm.

mrakolice avatar mrakolice commented on August 21, 2024

Hmmm... But without some changing in SchemaInterface I'm still not able to do some small manual schema customization. =)

from orm.

mrakolice avatar mrakolice commented on August 21, 2024

Schema recreating works at first look, thanks for your response!

from orm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.