-
Notifications
You must be signed in to change notification settings - Fork 103
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
django-pyodbc bulk_create is broken #132
Comments
Got an S.S.C.C.E <http://sscce.org/>?
…On Wed, Dec 7, 2016 at 11:31 AM, Adam Ergener ***@***.***> wrote:
I posted this on stackoverflow: http://stackoverflow.com/
questions/41025790/django-pyodbc-bulk-create-is-broken
When calling bulk_create() using django-pyodbc backend, an insert
statement is run for each object in the batch. The behavior should be to
run a single insert statement per batch.
Is this a bug, or is there a way to alter this behavior?
Versions:
django==1.7
pyodbc==3.0.10
django-pyodbc==1.0.1
FreeTDS v1.00.21
unixODBC v2.3.4
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#132>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AD_flA5V3RxGB9ZpxnbIXTeH8A4A3tMgks5rFwmqgaJpZM4LHAUj>
.
|
Working on one right now that I'll post here. But basically anytime a model calls |
With the following model: from django.db import models
class Thing(models.Model):
prop = models.CharField(max_length=64) Execute the following below from the django shell:
If you enable logging, you'll see that a SQL INSERT statement is executed for each item in the bulk_create batch. |
I also have an example setup here https://github.com/aergener/django-mssql-setup-example It uses docker so as long as you have Docker installed, you'll be able to launch the exact same setup. There's also a vagrantfile there if you have vagrant and want it to provision a machine for you with Docker. Currently that setup is using django-pyodbc-azure, but if you update the database settings & the requirements.txt to the following you should see what I am seeing. requirements.txt
|
I posted this on stackoverflow: http://stackoverflow.com/questions/41025790/django-pyodbc-bulk-create-is-broken
When calling bulk_create() using django-pyodbc backend, an insert statement is run for each object in the batch. The behavior should be to run a single insert statement per batch.
Is this a bug, or is there a way to alter this behavior?
Versions:
django==1.7
pyodbc==3.0.10
django-pyodbc==1.0.1
FreeTDS v1.00.21
unixODBC v2.3.4
The text was updated successfully, but these errors were encountered: