Raw SQL

Noun · Development

Definitions

  1. Hand-written SQL statements executed directly against a database, bypassing an ORM or query builder. Developers drop to raw SQL for complex queries, performance-critical paths, or database-specific features (CTEs, window functions, EXPLAIN plans) that the ORM cannot express idiomatically.

    In plain English: Writing database commands by hand instead of letting a framework generate them for you.

    Example: "The ORM generated a five-join monstrosity — I rewrote it as raw SQL with a CTE and the query went from 3 seconds to 40ms."

Related Terms