{"categories":[{"label":"Database","url":"https://skillfed.io/packages/category/database/4"}],"enrichment":{"capability":"Generates parameterized SQL queries from Jinja2 templates, automatically binding variables to prevent SQL injection while supporting conditional logic, macros, and multiple parameter styles.","skillfed_tags":["sql-templating","injection-prevention"],"use_cases":["Build dynamic reporting queries with conditional WHERE clauses, GROUP BY, and aggregations that an ORM cannot express cleanly","Generate parameterized bulk update or migration scripts using Jinja macros and loops while maintaining SQL injection safety","Construct multi-table SELECT queries with optional joins and filters based on runtime conditions","Support IN clauses with the inclause filter to bind list elements as separate parameters for database drivers","Escape table and column names safely using the identifier filter when dynamic schema references are required"],"what_it_does":"JinjaSQL is a template engine that generates parameterized SQL queries from Jinja2 templates. It processes template variables and conditional logic, then outputs a query with placeholders and a separate dictionary or tuple of bind parameters, ensuring values are never inlined into the SQL string itself. The package supports multiple parameter styles (named, format, qmark, numeric, pyformat, asyncpg) to match different database drivers' conventions.\n\nThe package is designed for scenarios where raw SQL is necessary\u2014reporting, aggregation, bulk migrations, and multi-table queries\u2014rather than as an ORM replacement. It protects against SQL injection by binding all template variables as parameters, though templates themselves must be trusted code (the sqlsafe and identifier filters allow deliberate inlining when needed). You prepare the query and parameters, then execute them using your database driver of choice.","worth_installing":"Yes, if you need to generate dynamic SQL queries safely in Python and your use case genuinely requires raw SQL (reporting, complex aggregations, bulk operations). The package is lightweight, actively maintained, has no known vulnerabilities, and supports modern Python versions. Not necessary if an ORM handles your queries adequately."},"id":"jinjasql2","links":{"html":"https://skillfed.io/packages/jinjasql2","md":"https://skillfed.io/packages/jinjasql2.md","pypi":"https://pypi.org/project/jinjasql2/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-07","license_spdx":null,"license_treatment":"permissive","name":"jinjasql2","python_support":"supports_current","summary":"Generate SQL Queries and Corresponding Bind Parameters using a Jinja2 Template"},"popularity":{"monthly_downloads":142297,"position":11214,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.1.13"}
