Skip to main content

Native postgres bulk update and upsert operations.

Project description

django-pgplus, forked from django-manager-utils, provides several optimized bulk operations for Postgres:

  1. update - For updating a list of models in bulk. Although Django provides a bulk_update in 2.2, it performs individual updates for every row and does not perform a native bulk update.

  2. upsert - For doing a bulk update or insert. This function uses postgres UPDATE ON CONFLICT syntax to perform an atomic upsert operation. There are several options to this function that allow the user to avoid touching rows if they result in a duplicate update, along with returning which rows were updated, created, or untouched.

  3. sync - For syncing a list of models with a table. Does a bulk upsert and also deletes any rows in the source queryset that were not part of the input data.

For more examples, see the django-pgbulk docs.

Documentation

View the django-pgbulk docs here.

Installation

Install django-pgbulk with:

pip3 install django-pgbulk

After this, add pgbulk to the INSTALLED_APPS setting of your Django project.

Contributing Guide

For information on setting up django-pgbulk for development and contributing changes, view CONTRIBUTING.rst.

Primary Authors

  • @wesleykendall (Wes Kendall)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-pgbulk-1.0.0.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

django_pgbulk-1.0.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file django-pgbulk-1.0.0.tar.gz.

File metadata

  • Download URL: django-pgbulk-1.0.0.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.2 Linux/4.15.0-1067-aws

File hashes

Hashes for django-pgbulk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e7cc4e65ac23e2d0b617479026d20dcfe7d6f31b974d61d7be68ee52284b4da1
MD5 2118de6a03fd78da0d679516c0505faf
BLAKE2b-256 80279f63f0374449ae0153f82e238fc3394139cf1daf760d2efe451bba756f9e

See more details on using hashes here.

File details

Details for the file django_pgbulk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: django_pgbulk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.2 Linux/4.15.0-1067-aws

File hashes

Hashes for django_pgbulk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84bc6b4c9bfcf6c9392485f87b3dd613d3317a0770bd9448e7bf9247dfd65988
MD5 cc8a63ba8c732ee9660fae6ac23f6b0c
BLAKE2b-256 f5209c851291e163a9d5957d0575b97820728f16cc884935e1b12944e2097ea0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page