{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/20"},{"label":"Internet","url":"https://skillfed.io/packages/category/internet/5"}],"enrichment":{"capability":"buildpg constructs PostgreSQL prepared statements with named parameter substitution and asyncpg integration, supporting complex WHERE clauses, value sets, and SQL operators via Python expressions.","skillfed_tags":["query-builder","asyncpg","sql-generation"],"use_cases":["Build parameterized SELECT queries with dynamic WHERE clauses by combining V() objects with Python operators instead of string concatenation.","Insert multiple rows using the Values() helper to generate column names and placeholders from keyword arguments.","Construct complex conditionals programmatically\u2014add AND/OR conditions only when certain flags are true, avoiding manual SQL string building.","Wrap asyncpg pool operations to accept named parameters directly without manually calling render() before each query.","Generate SQL with PostgreSQL-specific operators (contains @>, overlap &&, text search @@) using Python method calls on V() objects."],"what_it_does":"buildpg is a query builder that translates Python expressions into PostgreSQL prepared statements with parameter binding. It accepts named placeholders (`:foo`, `:bar`) in SQL strings and replaces them with positional parameters (`$1`, `$2`) suitable for asyncpg, while collecting the parameter values into a list. It also provides a `V()` wrapper for SQL identifiers and constants, allowing you to build complex WHERE clauses using Python operators (`&` for AND, `|` for OR, `==` for equality, etc.) and SQL functions like `funcs.count()`, `funcs.upper()`, and `funcs.position()`.\n\nThe package includes an optional asyncpg integration layer that wraps pool and connection methods with `*_b` variants (e.g., `fetch_b`, `fetchval_b`, `execute_b`) that accept buildpg-style named parameters and handle the rendering internally. It has no external runtime dependencies and installs as a pure Python wheel. However, the project is no longer maintained\u2014the last release was in March 2022 and the repository has seen no commits since July 2023.","worth_installing":"Yes, if you are using asyncpg and want to avoid manual string concatenation for parameterized queries, and you accept the maintenance risk. The package is stable and has no known vulnerabilities, but it is abandoned and will not adapt to breaking changes in asyncpg or Python. Use it for new projects only if you are comfortable pinning asyncpg and Python versions, or if you plan to fork and maintain it yourself."},"id":"buildpg","links":{"html":"https://skillfed.io/packages/buildpg","md":"https://skillfed.io/packages/buildpg.md","pypi":"https://pypi.org/project/buildpg/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2022-03-01","license_spdx":null,"license_treatment":"permissive","name":"buildpg","python_support":"supports_current","summary":"Query building for the postgresql prepared statements and asyncpg."},"popularity":{"monthly_downloads":103200,"position":12823,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.4"}
