pythonbulkinsertcrateexecutemanycratedb

How can I perform a bulk insert with python in CrateDB?


I'm trying to do a bulk insert using python in CrateDB. The command executemany doesn't really perform a bulk insert, in the same way it does with SQL Server using pyodbc. With pyodbc I can use this:

cursor.fast_executemany = True

to solve the problem, as mentioned here. But with the library "crate" for python I don't have this option. Is there a workaround?


Solution

  • unlike pyodbc the cratedb python driver does a real bulk insert without that option. see the example in our documentation https://crate.io/docs/clients/python/en/latest/client.html#inserting-data