# Placeholders, and Why SQL Is Never Built from Strings

SQL built with an f-string lets whatever a person types become part of the query, so a name such as x' OR '1'='1 turns one search into "every row", which is SQL injection, and ? or :name placeholders stop it by sending each value separately from the SQL.

![Cheat sheet: Placeholders, and Why SQL Is Never Built from Strings](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/bba7b9949ee146bd94c7b9d759267b16.webp)

- Category: FastAPI
- Level: Journeyman
- Tags: database, Parameterized Query, sql, SQL Injection, sqlite
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/fastapi-sql-placeholders-and-injection-cheat-sheet
