PostgreSQL cannot resolve the type of a parameterized $1 = 0.005 in -$1 * EXTRACT(EPOCH ...) and fails with an operator type error. Using sql.raw() embeds the constant directly in the query string so userId is the only parameter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>