prorm API Reference
    Preparing search index...

    Function literalExpr

    • Create a literal SQL expression (inserted as-is into the query) Returns { __type: 'literal', sql: string } format Use with caution - this can lead to SQL injection if user input is included

      Parameters

      • sql: string
      • Optionalbindings: unknown[]

      Returns LiteralExpression

      literalExpr('COUNT(*)')  // -> { __type: 'literal', sql: 'COUNT(*)' }
      literalExpr('NOW()') // -> { __type: 'literal', sql: 'NOW()' }
      literalExpr('1 + 1') // -> { __type: 'literal', sql: '1 + 1' }