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.1.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

django_pgbulk-1.1.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-pgbulk-1.1.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.4 Linux/5.11.0-1022-aws

File hashes

Hashes for django-pgbulk-1.1.0.tar.gz
Algorithm Hash digest
SHA256 225e0c4f761f396e1d12e3834fbf433b423ba582b54d5df799456434c263e51f
MD5 4022d5b17d773b6bdc5b06834f25c0b3
BLAKE2b-256 aa6286f78f6b4610fdafb2d2c982a5bea59782b38d8ecbc26bb630e37b2d9033

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_pgbulk-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.4 Linux/5.11.0-1022-aws

File hashes

Hashes for django_pgbulk-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d7134de18699dca2469f63b10df3baa686cb418ae8d1411897a9d8317e82867
MD5 c501716613b54ddc0c59904f81838b99
BLAKE2b-256 f0017a94d3d90009113e8c70268f39eaaf05ee71b2166da3b4a28f115abf96b5

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