Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have ability to perform bulk insert. #400

Open
tooolya opened this issue Oct 25, 2018 · 12 comments
Open

Have ability to perform bulk insert. #400

tooolya opened this issue Oct 25, 2018 · 12 comments

Comments

@tooolya
Copy link

tooolya commented Oct 25, 2018

Hi,

I use database adapter directly for performing bulk inserts. Is it possible to perform such thing via Pony?

In example, something like this:

class Doctor(database.Entity):
    code = pony.Required(str, unique=True)
    last = pony.Optional(str)
    first = pony.Optional(str)

with pony.db_session:
    Doctor.insert_many([{'code': 'test1',
                         'last': FAKE.last_name(),
                         'first': FAKE.first_name()},
                        {'code': 'test2',
                         'last': FAKE.last_name(),
                         'first': FAKE.first_name()}])

Expected: 2 rows insert as one bulk insert.

Or is there another way/pattern to do this with Pony?

Thank you!

@krassowski
Copy link

It would be very useful for me too

@Vitalium
Copy link

+1

@pmucci
Copy link

pmucci commented Apr 5, 2019

Much needed for me as well - an essential feature for using Pony on large (and growing) datasets.

@PlatonB
Copy link

PlatonB commented Feb 19, 2022

It's strange that such powerful ORM doesn't provide this yet.

@Hamzakhalid01
Copy link

coming from a background of .NET and Entity Framework, this is a must-have feature.

@0xWTC
Copy link

0xWTC commented Feb 27, 2022

would be really cool to have it

@minalike
Copy link

Yes please!

What is the best way to ingest large amounts of data otherwise? My use case is importing tens of millions of records at a time, on a monthly basis, from text files.

@pmucci
Copy link

pmucci commented May 29, 2022 via email

@KybraNET
Copy link

KybraNET commented Aug 8, 2022

That is extremely weak. At first I thought this thread was a hoax. I can only agree with @Hamzakhalid01, as someone who comes from the .net world this is completely unimaginable. This is a basic functionality, why is it not implemented?!? Sorry to be so direct, but from my perspective, pony is just a fun project that is not suitable for the real world. Scalability is not given, which means its a nonsensical ORM🤬 @minalike You have to use some other ORM until they provide Bulk Inserts.

@FajarMerahDiwangkara
Copy link

It is unthinkable that pony doesnt have this basic feature while inserting large bulk of data is a common practice

@TheAgentSuiteInc
Copy link

It appears implemented in the docs: https://ponyorm.readthedocs.io/en/latest/api_reference.html#collection-attribute-methods (look under add)

@pmucci
Copy link

pmucci commented Jun 12, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests