module
Prostore::SQL
Overview
A literal SQL fragment passed verbatim to the backend.
SQL.expr("now()") is intended for static expressions in default:,
backfill:, and where: (partial index predicate) options. The library
does not parse the fragment — portability across SQLite and PostgreSQL is
the user's responsibility when targeting both.
The macro wrapper at Prostore::SQL.expr rejects non-string-literal
arguments at compile time to prevent accidental Crystal-value
interpolation that would produce SQL injection.
Defined in:
prostore/sql_expr.crMacro Summary
-
expr(literal)
SQL.expr("...")— must be a string literal.
Macro Detail
macro expr(literal)
#
SQL.expr("...") — must be a string literal.
Compile error if argument is interpolation, a method call, or a variable.