GithubHelp home page GithubHelp logo

Bulk processing about modelmanager HOT 5 OPEN

pomm-project avatar pomm-project commented on July 20, 2024
Bulk processing

from modelmanager.

Comments (5)

chanmix51 avatar chanmix51 commented on July 20, 2024

That’s because of the IdentityMapper. It keeps a cache of all the instances fetched from the database to ensure that if a record is fetched twice it will return the same instance hence an update on the instance will update it everywhere.

The model manager is an entity CRUD oriented model. What you are trying to do in PHP would by far be better done in SQL using the SimpleQueryManager:

WITH
   deleted_foo AS (DELETE FROM foo WHERE {condition} RETURNING foo_id)
SELECT 
  count(foo.foo_id)         AS existing_count,
  count(deleted_foo.foo_id) AS deleted_count
FROM foo, deleted_foo

from modelmanager.

mvrhov avatar mvrhov commented on July 20, 2024

Well that was not an good example :)
What to remove was to be decided after the record was fetched and looking at the disk if the file exists.

from modelmanager.

chanmix51 avatar chanmix51 commented on July 20, 2024

I think maybe you should use a ConvertedResultIterator for this, you do not really need OO entities for this.

from modelmanager.

mvrhov avatar mvrhov commented on July 20, 2024

This means that I have to mix arrays and entities which is not nice. Having the ability to clear those entities would be nice.
Also using pomm in running long running processes e.g queue processors would benefit from this.

from modelmanager.

chanmix51 avatar chanmix51 commented on July 20, 2024

This is the job of another model manager, it will pop in in 3.0

from modelmanager.

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.