{"categories":[{"label":"Database","url":"https://skillfed.io/packages/category/database/4"}],"enrichment":{"capability":"Executes bulk update and bulk create operations on PostgreSQL databases from Django, allowing efficient multi-record updates with conditional logic in a single query.","skillfed_tags":["django-extension","postgresql-optimization","bulk-operations"],"use_cases":["Batch-update user records with different status values based on user IDs in a single query.","Perform upsert operations (insert or update) on large datasets using INSERT ON CONFLICT on PostgreSQL 9.5+.","Increment numeric fields (e.g., counters) across multiple records without fetching and re-saving each one.","Concatenate or merge array/JSONB fields across bulk records with custom set functions.","Build complex multi-condition WHERE clauses (OR-AND combinations) using the pdnf_clause helper."],"what_it_does":"django-pg-bulk-update is a Django extension that optimizes bulk update and create operations on PostgreSQL by generating raw SQL queries that handle multiple records with different values in a single database round-trip. It provides four main functions: bulk_update (updates multiple records), bulk_update_or_create (upsert pattern), bulk_create (creates multiple records), and pdnf_clause (builds complex OR-AND conditions as Django Q objects).\n\nThe package is designed for scenarios where you need to update or insert many rows with different field values based on key conditions\u2014operations that would otherwise require multiple queries or loops. It supports advanced PostgreSQL features like JSONB operations, INSERT ON CONFLICT, and custom set functions (increment, concatenate, array operations). The library requires PostgreSQL 9.4+ and integrates with Django's ORM through custom managers or direct function calls.","worth_installing":"Yes, if you are using Django with PostgreSQL and need to perform bulk updates or upserts on many records efficiently. The low install friction and permissive license make it straightforward to adopt. However, note that maintenance is dormant (last release 775 days ago)\u2014verify compatibility with your Django version before committing, and be aware of the documented race condition in bulk_update_or_create on PostgreSQL < 9.5."},"id":"django-pg-bulk-update","links":{"html":"https://skillfed.io/packages/django-pg-bulk-update","md":"https://skillfed.io/packages/django-pg-bulk-update.md","pypi":"https://pypi.org/project/django-pg-bulk-update/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-06-30","license_spdx":null,"license_treatment":"permissive","name":"django-pg-bulk-update","python_support":"unspecified","summary":"Django extension, executing bulk update operations for PostgreSQL"},"popularity":{"monthly_downloads":183078,"position":10074,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"3.7.3"}
