oracle-helpers
    Preparing search index...

    Class Sql

    Index
    • Parameters

      • rawStrings: readonly string[]
      • rawValues: readonly RawValue[]

      Returns Sql

    strings: string[]
    • get sql(): string

      Returns string

    • Join together multiple values into a single Sql instance

      Parameters

      • values: RawValue[]

        The values to join together

      Returns Sql

      an Sql instance with the values joined by the separator (the this Sql instance)

    • This synchronous method returns the input string as Sql validated to be a valid SQL identifier. If needed, it will be enclosed in double quotes to make it valid.

      Values will be enquoted if alwaysEnquote is true, or if its a simpleSqlName with capitalize false that doesn't include quotes. If a non quoted value is input with capitalize false, then even if its already a simpleSqlName, it will be enquoted to preserve the intended case.

      The default value of capitalize is true, so the input is converted to uppercase using locale-independent Unicode rules before quoting. Set capitalize to false to preserve case. Any input containing a double quote character is rejected.

      Uppercasing is done in the Node.js client and can differ from Oracle Database DBMS_ASSERT.ENQUOTE_NAME() behavior for some characters.

      NOTE Requires > OracleDB@v7

      Parameters

      • name: string | Sql

        — The string to be quoted for identifier use.

      • __namedParameters: EnquoteNameOptions = {}

      Returns Sql

    • This synchronous method returns the input value as a string that can safely be included in a SQL statement as a string literal.

      Embedded single quote characters are doubled. Non-string, non number values fail standard parameter validation.

      NOTE Requires > OracleDB@v7

      Parameters

      • value: string | number | bigint | Sql

        — The value to be converted to a SQL string literal.

      Returns Sql

    • Create raw SQL statement.

      This allows you to turn a variable directly into sql without making it a bind parameter.

      Warning This is dangerous and should only be used with trusted input or escaped input.

      Use Sql.name or Sql.literal instead whenever possible to ensure proper quoting and escaping.

      Parameters

      • value: string | number | bigint | Sql

      Returns Sql