{"categories":[{"label":"Database","url":"https://skillfed.io/packages/category/database/4"}],"enrichment":{"capability":"Provides simplified APIs for Django querysets to generate optimized SQL, particularly for subquery-based aggregations and existence checks that are more performant than Django's default JOIN-based approaches.","skillfed_tags":["django-orm","query-optimization","sql-generation"],"use_cases":["Annotate a Parent queryset with a count of related Child objects using a subquery instead of a JOIN for better performance.","Add a boolean annotation to check whether a parent has any children, using a simpler API than Django's native Exists.","Use SubqueryAggregate with PostgreSQL aggregates to collect related field values without writing complex subquery syntax.","Replace verbose Django subquery and OuterRef patterns with cleaner, more maintainable annotation calls.","Optimize queries that would otherwise use GROUP BY and JOIN, which can be slower than subquery-based aggregation."],"what_it_does":"django-sql-utils wraps Django's queryset annotation API to generate more efficient SQL for common aggregation patterns. Instead of using Django's default JOIN-based aggregations, it provides subquery-based alternatives like SubqueryCount, SubqueryMin, SubqueryMax, SubquerySum, and SubqueryAvg that often perform better on large datasets. It also simplifies the syntax for annotating querysets with existence checks via a streamlined Exists API.\n\nThe package targets developers working with Django who need to optimize query performance or find Django's native aggregation syntax verbose. It depends on django and sqlparse as runtime dependencies and requires Python >= 3.8. The codebase has been dormant since 2023-09-28, so compatibility with the latest Django releases is not guaranteed without verification.","worth_installing":"Yes, if you are actively using Django and need to optimize aggregation queries. The package solves a real performance problem and has a clean API. However, verify compatibility with your Django version first\u2014the package has been dormant since 2023-09-28 and may not work with very recent Django releases. No known security vulnerabilities."},"id":"django-sql-utils","links":{"html":"https://skillfed.io/packages/django-sql-utils","md":"https://skillfed.io/packages/django-sql-utils.md","pypi":"https://pypi.org/project/django-sql-utils/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2023-09-28","license_spdx":null,"license_treatment":"permissive","name":"django-sql-utils","python_support":"supports_current","summary":"Improved API for aggregating using Subquery"},"popularity":{"monthly_downloads":183905,"position":10053,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.7.0"}
