database-query

Enforce parameterized SQL queries across Python DB-API drivers.

3|1|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/dgriffin831/clawhub-skills --skill database-query-dgriffin831
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-query
Source: https://github.com/dgriffin831/clawhub-skills/tree/main/skill-scan/test-fixtures/sql-injection-query
Command: npx skills add https://github.com/dgriffin831/clawhub-skills --skill database-query-dgriffin831

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sqlite3.

What problem does it solve?

This Skill prevents SQL injection by enforcing parameterized queries for user-supplied input across Python DB-API drivers.

Core Features & Use Cases

  • Safe SQL execution using parameterized queries across SQLite, PostgreSQL, MySQL, and other DB-API compatible drivers.
  • Prevents injection in user-facing search, reporting, and data retrieval workflows.
  • Use Case: Build secure data access in web apps, automation scripts, and data pipelines by binding input parameters instead of string concatenation.

Quick Start

Use the database-query skill to perform a parameterized query, for example: cur.execute("SELECT * FROM users WHERE name=?", (name,))

Frequently Asked Questions about database-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQL injection in Python when using user-supplied input?

To prevent SQL injection in Python, use parameterized queries to bind user-supplied input instead of string concatenation. This Skill enforces safe query patterns by applying parameter binding across SQLite, PostgreSQL, MySQL, and other DB-API compatible drivers.

What's the best way to run parameterized queries across multiple Python database drivers?

The best way to run parameterized queries across multiple drivers is using the Python DB-API standard. This Skill enforces parameter binding for safe SQL execution, supporting SQLite, PostgreSQL, and MySQL to prevent injection in data retrieval workflows.

How do I execute a parameterized query in sqlite3 using Python?

You execute a parameterized query in sqlite3 by passing a tuple of parameters to the cursor's execute method, like cur.execute("SELECT * FROM users WHERE name=?", (name,)). This binds the input directly, preventing SQL injection in your Python scripts.

Does this SQL injection prevention approach work with PostgreSQL and MySQL connections in Python?

Yes, this SQL injection prevention approach works with PostgreSQL and MySQL connections in Python. It enforces parameterized queries across all DB-API compatible drivers, ensuring safe data access in web apps, automation scripts, and data pipelines.

Why does string concatenation in SQL queries create security vulnerabilities in my Python web app?

String concatenation in SQL queries creates vulnerabilities because it allows user-supplied input to be interpreted as executable SQL code. Enforcing parameterized queries separates code from data, binding input parameters securely to meet application security requirements.

When should I not use parameterized queries for database access in Python?

You should always use parameterized queries for database access in Python when handling user-supplied input to prevent SQL injection. The only limitation is that parameterized queries cannot be used for dynamic table or column names, which require basic validation.